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

Re: Where is my document? local source path discovery

Subject: Re: Where is my document? local source path discovery (was XSLT 2 Functions for URL Manipulation (was Rewriting href))
From: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Sun, 29 Jun 2008 12:00:59 -0500
Re:  Where is my document? local source path discovery
On 6/28/08 3:21 PM, "Marroc" <marrocdanderfluff@xxxxxxxxxxx> wrote:

> Wow Eliot - that is really useful, thanks. It took me a few minutes to read
> and understand but now I have, it has certainly saved me a great deal of
> time. Thanks very much.
> 
> The missing piece of the puzzle then is to discover the local source path
> from within the source document while it is being processed. Once I have
> that, I'm home and dry! Does anyone have further ideas?

In XSLT 2 you can use document-uri() to get the URI of the current document,
so:

<xsl:template match="/">
  <xsl:variable name="inputUrl" select="document-uri(.)" as="xs:string"/
</xsl:template>

In situations where the use of xml:base may have changed the base URI to
which a given relative path should resolve, you can use base-uri() rather
than document-uri(). For example, resolving references specified in incoming
attributes.

Cheers,

Eliot

----
Eliot Kimber | Senior Solutions Architect | Really Strategies, Inc.
email:  ekimber@xxxxxxxxxxxx <mailto:ekimber@xxxxxxxxxxxx>
office: 610.631.6770 | cell: 512.554.9368
2570 Boulevard of the Generals | Suite 213 | Audubon, PA 19403
www.reallysi.com <http://www.reallysi.com>  | http://blog.reallysi.com
<http://blog.reallysi.com> | www.rsuitecms.com <http://www.rsuitecms.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.