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

RE: document() for opening multiple documents

Subject: RE: document() for opening multiple documents
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 9 Jul 2003 14:16:22 +0100
xsl document
The base URI for nodes in a result tree fragment is the base URI of the
stylesheet (more strictly, the base URI of the xsl:variable element used
to construct the RTF.)

This may be a case where you want to use the second argument of the
document() function to supply a base URI more precisely.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Vitaly Ostanin
> Sent: 08 July 2003 16:57
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  document() for opening multiple documents
> 
> 
> Hello.
> 
> I try to use function document() http://www.w3.org/TR/xslt#document
> for opening multiple source documents, specified in variable 
> $file-set (using extension exsl:node-set()).
> 
> Main style:
> <?xml version='1.0'?>
> <xsl:stylesheet 
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     version='1.0'>
>   <xsl:import href="xsl/included.xsl"/>
> </xsl:stylesheet>
> 
> Included style (xsl/included.xsl):
> <?xml version='1.0'?>
> <xsl:stylesheet 
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:exsl="http://exslt.org/common" 
>     extension-element-prefixes="exsl"
>     version='1.0'>
>   <xsl:variable name="file-set">
>     <file>file1.xml</file>
>     <file>file2.xml</file>
>   </xsl:variable>
>   <xsl:template match="/">
>     <xsl:for-each
>        select="document(exsl:node-set($file-set)/file)"/>  
>      <xsl:variable name="file">file1.xml</xsl:variable>  
>      <xsl:for-each
>        select="document($file)"/>  
>   </xsl:template>
> </xsl:stylesheet>
> 
> 
> When I call document() with variable as first argument, 
> file1.xml opened from directory "xsl".
> 
> When I call document() with exsl:node-set($file-set) as first 
> document, files from $file-set opened (try to open) from the 
> current directory.
> 
> Please, tell me, what is the base URI for relative URI's from 
> node-set ?
> 
> I read
> http://www.w3.org/TR/xslt#base-uri
> but not fully understand it.
> 
> For my purposes I need include data from multiple files, and 
> count of files and filenames are not static. Next I need to use
> key() for accessing data.
> 
> In other test I try to include data into variable
> 
>   <xsl:variable name="file-set">
>     <xsl:copy-of select="document('file1.xml')"/>
>     <xsl:copy-of select="document('file2.xml')"/>
>   </xsl:variable>
> 
> but key() not work with variable 
> (for me - I use libxml2-2.5.8 and libxslt-1.0.31)
> 
> Anybody can help me, please?
> 
> -- 
> Regards, Vyt
> mailto:  vyt@xxxxxxxxx
> JID:     vyt@xxxxxxxxx
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.