Question : Get XSLT Stylesheet being applied to XML

I have an XML document that uses an XSLT stylesheet to format the data. i.e)

<xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="MyStyleSheet.xslt" ?>
<MyData>
 <MyElement></MyElement>
</MyData>

What I want to know is how within the XSLT I could get the href information. The stylesheet assigned to the XML is dynamically added, so I want the user to be able to see the stylesheet being used.

Answer : Get XSLT Stylesheet being applied to XML

Try this:
1:
<xsl:value-of select="substring-before(substring-after(/processing-instruction('xml-stylesheet'),'href=&quot;'),'&quot;')"/>
Random Solutions  
 
programming4us programming4us