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

Re: two xml source documents

Subject: Re: two xml source documents
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 1 Aug 2002 18:23:59 +0100
get lengt in xsl
Hi Charles,

> From The XSLT Programmer's Reference 2nd Edition, pg. 466, strictly
> speaking the first parameter is a URI which in my case is a file
> name and the second parameter is the base-uri which is used to
> resolve any relative reference contained in the first parameter.

It's not quite that simple: the second argument to the document()
function is a *node-set* and the base URI (used to resolve the first
argument) is the base URI of the first node in that node set. The base
URI of a node is the location in which it originated. Usually you'd
pass the context node as the second argument, something like:

<xsl:template match="xi:include">
  <xsl:copy-of select="document(@href, .)" />
</xsl:template>

to ensure that the first argument is resolved relative to the XML
document in which the URI is specified rather than relative to the
stylesheet itself.

I'm very surprised that:

  document('contractorList.xml', '../xml/')

works for you. I get errors when I try using that with Saxon, MSXML or
Xalan-J...

(Also, the first argument can be a node-set rather than a URI, in
which case you get a node-set containing all the root nodes of all the
documents referenced.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.