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

Re: Get Stylesheet name

Subject: Re: Get Stylesheet name
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 13 Mar 2003 15:55:19 +0000
stylesheet name
Hi Ankit,

> I know this is a way off the topic but could somebody please tell me
> how to extract the name of a stylesheet from the xml document.
> My problem is to get the stylesheet applied to an xml doc and then
> import the same stylesheet in a new stylesheet to apply to another
> document.

I assume that your XML document includes a <?xml-stylesheet?>
processing instruction that points to the stylesheet that you want to
get the name of?

If so, you can locate that PI using:

  <xsl:variable name="PI"
    select="/processing-instruction('xml-stylesheet')" />

and then get the stylesheet name by string processing the value of the
PI. Assuming the PI uses double quotes around the href
pseudo-attribute value, for example, you can use:

    select="substring-before(substring-after($PI, 'href=&quot;'),
                             '&quot;')" />



Jeni Tennison

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.