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

Re: xslt 2.0, use case wanted.

Subject: Re: xslt 2.0, use case wanted.
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 6 Apr 2004 17:27:37 +0100
xslt usecase
Elliotte Rusty Harold wrote:
> At 8:33 AM +0100 4/6/04, David.Pawson@xxxxxxxxxxx wrote:
>
>>The comparison I might make is the availability of the name of the
>>source file. Lots of people want it, and its only available as a
>>parameter to the stylesheet.
>
> By source file, do you mean the name of the XSLT stylesheet or of
> the input XML document being transformed?
>
> In either case, there may not always be such a name. Both of these
> can be provided as pure input streams or other non-named things.
> However, if the thing is named I expect there's an accessor for the
> base URI of a node somewhere that would give you what you want, at
> least for the input document, if not the stylesheet.

Indeed, you can access the base URI for a node using the base-uri()
function in XPath 2.0. So if you want to know the filename for the
input document, you can do:

<xsl:variable name="input-uri" select="base-uri(/)" />

and if you want to know the filename for the stylesheet, you can do:

<xsl:variable name="stylesheet-uri" select="base-uri(doc(''))" />

Cheers,

Jeni

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

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.