|
Subject: [xsl] Flattening a XML tree From: Mir Farooq Ali <mfali@xxxxxxxxxxxxxxxx> Date: Mon, 1 Oct 2001 23:59:54 -0400 (EDT) |
Hi,
I have an input tree that looks like this
<?xml version="1.0"?>
<Tree>
<TreeNode id="1" weight="5">
<TreeNode id="2" weight="3">
<TreeNode id="6" weight="2"/>
<TreeNode id="7" weight="2"/>
<TreeNode id="8" weight="2"/>
</TreeNode>
<TreeNode id="3" weight="4">
<TreeNode id="9" weight="3">
<TreeNode id="11" weight="2"/>
<TreeNode id="12" weight="2"/>
</TreeNode>
<TreeNode id="10" weight="2"/>
</TreeNode>
<TreeNode id="4" weight="2"/>
<TreeNode id="5" weight="2"/>
</TreeNode>
</Tree>
I need to flatten the tree to a structure that looks like this. I've
looked at the archives, but haven't found an answer.
<?xml version="1.0"?>
<Tree>
<TreeNode id="1" weight="5">
<TreeNode id="2" weight="3"/>
<TreeNode id="3" weight="4"/>
<TreeNode id="4" weight="2"/>
<TreeNode id="5" weight="2"/>
<TreeNode id="6" weight="2"/>
<TreeNode id="7" weight="2"/>
<TreeNode id="8" weight="2"/>
<TreeNode id="11" weight="2"/>
<TreeNode id="12" weight="2"/>
<TreeNode id="9" weight="3"/>
<TreeNode id="10" weight="2"/>
</TreeNode>
</Tree>
Any help is appreciated.
Thanks,
-Farooq.
+---------------------------------+-------------------------------------+
| Ph.D. Candidate | (540) 5520967 (R) (540) 2313986 (W)|
| Department of Computer Science | Email: mfali@xxxxxx |
| Virginia Tech. | Web: http://csgrad.cs.vt.edu/~mfali |
+---------------------------------+-------------------------------------+
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] DTD for XSLT, Colin Paul Adams | Thread | RE: [xsl] Flattening a XML tree, Casadome, Francisco |
| Re: [xsl] XML to Word Document, Paul Tyson | Date | Re: [xsl]: How to handle two XML so, Paul Tyson |
| Month |