[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem using transformNode in html transformed f

Subject: Re: Problem using transformNode in html transformed from XML
From: "Carsten Klein" <carstenklein@xxxxxxxx>
Date: Thu, 21 Mar 2002 09:35:00 +0100
transformnode parameters
Hi Steve,

well, as far as I can see, you are using a free threaded document
(bug.xml) in conjunction with
a non threaded document (bug.xsl). You should be using both either
as non threaded or free threaded.
I had the same problem in a little project i have done, here is a
code snipped of this

var treeviewXML = new
ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
treeviewXML.async = false;

var treeviewXSL = new
ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
treeviewXSL.async = false;
treeviewXSL.load("treeview.xsl");

When using the free threaded document object you have to create a
processor each time you do the
transformation and a template would be quite useful, if the
transformation is done quite often, to save some
execution time, since the template stores the document in a compiled
state

var treeviewTXSL = new ActiveXObject("Msxml2.XSLTemplate.4.0");
treeviewTXSL.stylesheet = treeviewXSL;

In my transformation routine I use

function transform(aNode, aXMLdoc, aTemplate, aParameters) {
    var vXSLTProc = aTemplate.createProcessor();
    vXSLTProc.input = aXMLdoc;
    if (aParameters)
    for (var vCount=0;vCount<aParameters.length;vCount++)
        vXSLTProc.addParameter(aParameters[vCount][0],
aParameters[vCount][1], aParameters[vCount][2]);
    vXSLTProc.transform();

   aNode.innerHTML = vXSLTProc.output;
}

The transform function takes a dom node (e.g. the DIV you are
talking about), the xml document (fragment) which is going to be
transformed (treeviewXML, bug.xml), the template used (treeviewTXSL)
and optional
parameters array of the form

        array(
            array(<paramName>, <value>, <namespaceURI>) [,
array()...]
        )

    e.g.

        array(
            array(foo", "bar", ""),
            array("john", 1, "")
        )

Please note, that the parameter values may only consist of data
which may eventually evaluate to a string
or number value (dates and the like). The third parameter value is
an optional namespace uri.

See
<a
href="http://msdn.microsoft.com/library/en-us/xmlsdk/htm/xml_mth_ac_
5pgy.asp?frame=true">MSDN library Topic addParameter Method</a> and
others.

This may solve your problems.

Bye

Carsten


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.