xsl-list
[Top] [All Lists]

RE: Get and save Stylesheet of XML Doc

2003-03-17 11:58:37
[Ankit Jain]

Ya, its specified in the XML source but I am unable to get 
the MSXML code for retreiving the stylesheet name. I tried 
the SelectsingleNode("//processing-instruction") method but 
it works inside the browser but returns an error inside the 
MSXSML code.


If the context is the document element, then this xslt expression will
get you the string with the name of the stylesheet -

<xsl:value-of
select='substring-after(processing-instruction(),"href=")'/>

There are some caveats -

1) It will not work if there are spaces around the "=".  If this could
happen, you have to write a smarter expression.
2) You will have to get rid of the quote marks surrounding the url.

You ought to be able to cause this to be done programmatically with
msxml.

Cheers,

Tom P

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



<Prev in Thread] Current Thread [Next in Thread>