[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xform from node-within-node to nodelist-then-edgelist?

Subject: xform from node-within-node to nodelist-then-edgelist?
From: Martin Whinnery <martin@xxxxxxxxxxxxxxxxxxx>
Date: 23 Mar 2004 21:46:28 +0000
xform
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.