xsl-list
[Top] [All Lists]

RE: Can one Use JavaScript to update XSL:Variables

2004-07-29 10:26:24
Great example.  Thanks Pieter!

But, say I want to perform a browser check via js.
I would probably create an init_ie(), transform_ie(), init_ns(), and 
transform_ns(). 

Basically this code looks really simple and perhaps netscape has
some similar objects to use??

Any suggestions?


    <script language="javascript">
      var ss, cache;

      function init()
      {
        // create and load XSLT stylesheet ? must be free-threaded
        ss = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.4.0');
        ss.async = false;
        ss.load('stylesheet.xsl');

        // create XSLTemplate object and compile stylesheet into it
        cache = new ActiveXObject("Msxml2.XSLTemplate.4.0");
        cache.stylesheet = ss;
      }

      function transform(source)
      {
        // create and load source document
        var src = new ActiveXObject('MSXML2.DOMDocument.4.0');
        src.async = false;
        src.load(source);

        // retrieve cached XSLProcessor and transform the source document
        var proc = cache.createProcessor();
        proc.input = src;
        proc.transform();
        target.innerHTML = proc.output;
      }
    </script>





--- Pieter Reint Siegers Kort <pieter(_dot_)siegers(_at_)elnorte(_dot_)com> 
wrote:

OK Dave, then

http://www.perfectxml.com/articles/xml/XSLTInMSXML.asp

should help you getting it to work.

If you need additional info let us know.

Cheers,
<prs/>



                
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo