[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Get 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: <xsl:value-of select="substring-before(substring-after($PI, 'href="'), '"')" /> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|