Subject: Re: [xsl] xform from node-within-node to nodelist-then-edgelist? From: Brian Chrisman <brian.chrisman@xxxxxx> Date: Tue, 23 Mar 2004 15:23:31 +0100 |
in your match="/" template, could you first do a: <apply-templates select="//node" mode="nodelist"/> and then <apply-templates select="//node" mode="edgelist"/>
Hope this isn't too dumb-ass a question..
I've got an input file, of the form..
<node> <node>blah blah</node> <node> <node>blah blah</node> </node> <node>
so basically an outline structure.
I want to transform this into a structure suitable for display using the touchgraph linkbrowser, which wants files of the form..
<nodelist> <node id="1">blah blah</node> <node id="2">blah blah</node> <node id="3">blah blah</node> <node id="4">blah blah</node> </nodelist> <edgelist> <edge fromid="1" toid="2"> <edge fromid="1" toid="3"> <edge fromid="3" toid="4"> </edgelist>
I've left a bunch of irrelevant stuff out.
Now, I can create the edges no problem, by using generate-id() to make the node-id then passing the node-id as a parameter when I call the template recursively on the child nodes. No probs.
What I can't seem to work out is how to delay the output of the edges until after I have finished the nodes.
Any thoughts? Can I do this with XSLT? A friend whose opinions I respect has suggested that FO is what I need to be using, but I can't make head nor tail of that. Is he right? Do I need to go back and understand FO?
regards
Martin Whinnery
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xform from node-within-node t, Martin Whinnery | Thread | [xsl] Elminitate redundancy by usin, Kenny Akridge |
Re: [xsl] How to do... regular 1 to, Jeni Tennison | Date | [xsl] Table Normalization, Michael Müller-Hille |
Month |