[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Transforming multiple XML files into one file

Subject: Re: Transforming multiple XML files into one file
From: Chad Chelius <cchelius@xxxxxxxxxxxxxxx>
Date: Mon, 3 Jul 2006 08:48:25 -0400
file z
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.