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

Getting the current document from an xsl:function

Subject: Getting the current document from an xsl:function
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 28 Jun 2012 11:01:04 +0200
 Getting the current document from an xsl:function
Hi List,

It's been a while ;). However, today I was wondering about the
following: the function base-uri() returns the uri of the current xsl
document by default, when no context is given. But since there is no
context in xsl:function, this won't work automatically from a function,
instead I need to do something like:

<xsl:function name="my:current-dir" as="xs:string">
    <xsl:param name="context" as="node()" />
    <xsl:value-of select="replace(base-uri($context), '/[^/]+$', '')" />
</xsl:function>

Does anyone know a way to remove the constraint of passing on a context
item? The reaon I ask is that I'd like to be able to find the current
dir from places where there is no context. But, as far as I know, this
is currently not possible in XSLT 2.0.

Thanks,
Abel

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.