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

Re: XSLT V 1.1

Subject: Re: XSLT V 1.1
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 15 Sep 2000 11:34:21 GMT
Re: XSLT V 1.1

> I don't understand what you're saying. Could you please 
> provide an XSL code or pseuodocode to explain why 
> I need something other than top-level URI ?

suppose the source file has

<mumble href="xxx.xml"/>

and I want the stylesheet to use document() to follow that link then
I need

<xsl:template match="mumble">
 <xsl:apply-templates select="document(@href,????)"/>
</xsl:template>

Currently ???? is . so I get the URI of the current mumble node as the
base URI with which to resolve the relative URI ref.

You haven't suggested any way so far in which to get this functionality
with your proposed replacement.

Except for little example files as posted to this list, in real
documents around here, the base URI of the mumble node is _almost never_
the base URI of the root of the input document. Chapters sections etc
almost always live in subdirectories of the directory containing the
root node.

If you were looking to change things, I think it would be simpler to use
a one-argument form of document() along with two functions, as follows

select="document(uri-resolve-with-base(@href,uri-of-node(.)))"

where uri-resolve-with-base() takes two strings and makes an absolute
URI (essentially by removing anything after the last / in the base,
concatenating that with the relative URI and then cleaning up ../ and ./
segments, or just returning the first argument if it is already absolute)

and uri-of-node() returns the URI of the first node in its node-set
argument.


David


 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.