Forum Moderators: open
I have an XML file that resembles something like this:
<Node>
<LocationBase url="http://example.com/foo/" />
<Node>
<Item>
<Id>12345</Id>
</Item>
<Item>
<Id>98765</Id>
</Item>
</Node>
</Node>
Each Item represents another XML file located at LocationBase. For example:
http://example.com/foo/12345.xml
and
http://example.com/foo/98765.xml
Those files might look like this:
<folder>
<list>
<record />
<record />
</list>
<folder>
<list>
<record />
</list>
</folder>
</folder>
Note, in the first example there could be any number of nested Nodes, and in this example there could be any number of nested folders.
Is there a way to combine these (with XLST) into a single structure like this:
<Node>
<LocationBase url="http://example.com/foo/" />
<Node>
<Item>
<folder>
<list>
<record />
<record />
</list>
<folder>
<list>
<record />
</list>
</folder>
</folder>
</Item>
<Item>
<folder>
...
</folder>
</Item>
</Node>
</Node>
Any input appreciated.
reference:
[w3.org...]
example:
<xsl:variable name="doc2" select="document('/foo/12345.xml')" />