Results 1 to 4 of 4

Thread: xsl parameter

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    49

    xsl parameter

    Good Day!

    How may be send parameter to xsl stylesheet
    from JavaScript function?


    Thank!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    JavaScript runs only after all XSL processing is completed, so I don't think you can do that.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    49
    Thank you!



    I find it
    for xml2 and higher:

    --------------------------------------------------------------------------------
    var xslt = new ActiveXObject("Msxml2.XSLTemplate");
    var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
    var xslProc;
    xslDoc.async = false;
    xslDoc.load(xslPath);

    xslt.stylesheet = xslDoc;
    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
    xmlDoc.async = false;
    xmlDoc.load(xmlPath);

    xslProc = xslt.createProcessor();
    xslProc.input = xmlDoc;
    xslProc.addParameter("paramName", "paramValue");
    xslProc.transform();

    try {
    xslProc.transform;
    result.innerHTML = xslProc.output;
    }
    catch(e)
    {
    result.innerHTML = e.description;
    }

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    *sigh*
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width