[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: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 3 Jul 2006 14:12:51 +0100
Re:  Transforming multiple XML files into one file
> 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?


<xsl:copy-of select="(document('file1.xml')|document('file2.xml')|document('file3.xml'))/story"/>

or if it's more convenient have a list.xml that looks like
<files>
 <file>file1.xml</file>
 <file>file2.xml</file>
 <file>file3.xml</file>
</files>

then you can co

<xsl:copy-of select="document(document('list.xml')/files/file)/story"/>

in xslt2 you can use the collection() function which essentially
automates (and hides) the generation of the list.xml file, but in XSLT1
you need to have this file list to hand either by making it manually or
9for example) modifying a directory listing. Some web service setups
have an option of supplying a listing in XMl format so sometimes you
don't need to make an actual file list xml file, just use an http URI
pointing at the directory.

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.