Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: "Michael Kay" <mike@------------>
To:
Date: 7/3/2006 10:58:00 PM
If the argument to the document() function is a string containing a relative
URI, then it is interpreted relative to the base URI of the stylesheet
element in which the document() call appears.

So in layman's terms, if you say document('thing.xml') then you are
referring to a file in the same directory as the stylesheet.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Chad Chelius [mailto:cchelius@xxxxxxxxxxxxxxx] 
> Sent: 03 July 2006 20:32
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Transforming multiple XML files into one file
> 
> David,
> How does the XSLT know the exact location of the files that 
> you are listing. Do they need to be located in the same directory?
> 
> 
> <chad/>
> 
> Chad Chelius
> AGI Training
> cchelius@xxxxxxxxxxxxxxx
> 
> 
> On Jul 3, 2006, at 9:12 AM, David Carlisle wrote:
> 
> > <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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent