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

Re: Referencing the filename of an XSL file in the same file

Subject: Re: Referencing the filename of an XSL file in the same file
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Mon, 08 May 2000 11:56:33 -0400
xml stylesheet same file
At 03:40 PM 05/08/2000 +0100, Philip McAllister wrote:
Is there any way I can reference the filename of a stylesheet within the
stylesheet:

<?xml-stylesheet type="text/xsl"
href="/home/httpd/html/en_GB/whelk/xsl/ticketing_venue_def.xsl"?>

Cool idea.


I don't know if this will work with Xalan, but you may be able to accomplish this using the document() function to refer to the stylesheet itself, and extract from it the xml-stylesheet PI -- using an XPath expression something like /processing-instruction("xml-stylesheet"). The catch is that href isn't a true attribute but a pseudo-attribute, so you will not be able to simply use the standard @href to get at its value. Instead, the value of a PI (per XPath spec, section 5.5) is a string which follows the target (the target being "xml-stylesheet" in this case) -- the pseudo-attributes (with their values) type and href. You could simply use this value or, if you must strip out the type pseudo-attribute, substring it for the href pseudo-attrib alone.

================================================================
John E. Simpson          | "I hate it when my foot falls asleep
http://www.flixml.org    | during the day because that means it's
simpson@xxxxxxxxxxx      | going to be up all night." (Steven Wright)


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.