xsl-list
[Top] [All Lists]

Re: [xsl] Transforming multiple XML files into one file

2006-07-03 05:45:44
David,
Sorry for not being clearer about this in the beginning. What I have is several separate XML files. We'll call them file1.xml, file2.xml, and file3.xml. What I want to do is take the <story> element from each one of those files and generate one big xml file on output that combines those elements. How would I do something like that?

chad

On Jun 21, 2006, at 5:27 AM, David Carlisle wrote:

not sure what you mean but if you have  a file
<files>
 <z>one.xml</z>
 <z>two.xml</z>
 <z>three.xml</z>
</files>

and go

<xsl:variable name="files" select="document(document('files.xml')/ files/z)"/>

then $files is a node set of three document nodes representing one.xml
two.xml and three.xml and you can apply
templates to all three at once with
<xsl:apply-templates select="$files"/>
or extract elements from all three documents with
xsl:for-each select="$files/some/path/to/here"

David


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--