<?xml-stylesheet type="text/xsl" href="whatever.xsl" ?>  
Author Message
David N.4117





PostPosted: XML and the .NET Framework, <?xml-stylesheet type="text/xsl" href="whatever.xsl" ?> Top

Hi all,

In my XML file, I have the following line for transformation:

< xml-stylesheet type="text/xslt" href="whatever.xsl" >

Is there a way to replace the whatever.xsl with a variable name so that during runtime, I can assign a value to the variable so that I can use the WebBrowser to transform my XML document differently.

For example, it would be nice if, instead of hard-code the whatever.xsl, I would like to use a variable, as shown below:

>

Thanks




.NET Development5  
 
 
Sergey Dubinets - MSFT





PostPosted: XML and the .NET Framework, <?xml-stylesheet type="text/xsl" href="whatever.xsl" ?> Top

Not this way.

I assume that you use IE 5 or higher.

You can use XSLT that generates you very simple page that has nothing on it but simple JScript that executes on page load. In this script you would have XML loaded to you by the browser and available as property of the document. So you can load stylesheet you need, use it to transform original XML (loaded by browser) and substitute page in the browser to newly generated one.