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

Re: Obtaining the base output uri from within xsl

Subject: Re: Obtaining the base output uri from within xsl
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 14 Dec 2011 12:07:34 +0000
Re:  Obtaining the base output uri from within xsl
On 14/12/2011 11:49, Clint Redwood wrote:
Hi,

I've been looking at the xsl functions for some way of gaining the base output uri, or better still, the output document name. I can find how to get the input document, the static context, but not the output document name.

I'm using Saxon with the -o parameter, so I could add an extra parameter to my stylesheet such as "outputURI=x", but that would seem messy.

I'm sure it's really obvious, but I've not found anything yet.

Thanks in advance.

Clint.


There's no packaged way of doing this in the standard function library or in Saxon, but you can write an extension function easily enough. Starting from "context" as the XPathContext object, it's just

context.getController().getBaseOutputURI();

which returns the base output URI as a string.

Michael Kay
Saxonica

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.