Subject: [xsl] extracting tree from flat xml data From: Larry_Mason@xxxxxx Date: Tue, 13 Mar 2001 16:04:21 -0600 |
Given the following xml where depth indicates the level within a tree, <data> <person> <node depth="0">granddad</node> </person> <person> <node depth="1">child 1</node> </person> <person> <node depth="1">child 2</node> </person> <person> <node depth="2">grandchild 1</node> </person> <person> <node depth="2">grandchild 2</node> </person> <person> <node depth="1">child 3</node> </person> </data> I would like to emit the following <table> <tr><td id="node_1">granddad</td></tr> <tr><td id="node_1_1"> child1</td></tr> <tr><td id="node_1_2"> child2</td></tr> <tr><td id="node_1_2_1"> grandchild 1</td></tr> <tr><td id="node_1_2_2"> grandchild 2</td></tr> <tr><td id="node_1_3"> child 3</td></tr> </table> The value for id is based on the relationship in the heirarchy. I have a JSP version of this working but need an XSLT solution also. It seems some processing of ancestors and their siblings is in order to build the value for id but the exact magic eludes me. The logic must initiated from within the 'node' template (no for-each processing by a "higher" template, ie data or person ). Any suggestions? Cheers! Larry Mason Senior Member Technical Staff i2 Technologies XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] copying source tree with , Michael Kay | Thread | Re: [xsl] extracting tree from flat, Jeni Tennison |
[xsl] Re:, Larry Garfield | Date | [xsl] flushing a variable in XSLT, chris probert |
Month |