Reputation: 51
I've got 4 different XML files which I want to join to make one file. How can I do that?
Each file contains a parent and at least 4 children. Parents are called genre 1,2,3,4
and the children are artist, name, etc. Each file is shown in an HTML table.
Can someone shed some light on this?
Upvotes: 0
Views: 116
Reputation: 96702
This XSLT template will do exactly what you've said you want done:
<xsl:template match="/">
<output>
<xsl:copy-of select="document('file1.xml')"/>
<xsl:copy-of select="document('file2.xml')"/>
<xsl:copy-of select="document('file3.xml')"/>
<xsl:copy-of select="document('file4.xml')"/>
</output>
</xsl:template>
If this isn't the right answer, add some more detail to your question.
Upvotes: 0
Reputation: 2553
Use the XSL document() function.
$d1 = document('doc1.xml'), document('doc2.xml'), ...
The comma's combine the loaded elements into a single sequence (at least in XSL 2, not sure about 1).
If you want the sequence of items within the genre tags use:
$d1 = document('doc1.xml')/genre, document('doc2.xml')/genre, ...
Upvotes: 1