XSL: Several XML files into one file

We have a lot of separate files and want to put them together into one.

Step 1: Create a list of all filenames as XML file


Step 2: Create an XSL transform

<xsl:template match="//files">
<xsl:for-each select="file">
<xsl:copy-of select="document(.)"/>

Note the use of “copy-of” – it will copy all the nodes and attributes from the source XML.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s