Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript parsing XSL

Status
Not open for further replies.

caesarkim

Programmer
Oct 30, 2003
56
US
I have a javascript function generating HTML by parsing XSL and XML. It was working fine. All of sudden, it stopped working.

I get "The XSL stylesheet document must be free threaded in order to be used with the XSL Template object"

Here is my code. Please help. Thanks.

var xslTemplate = new ActiveXObject("Msxml2.XSLTemplate.3.0");
var xmlProcessedOutput = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
var resultType = "html";
var xslProcessor = null;
xslTemplate.stylesheet = xslDoc;
xslProcessor = xslTemplate.createProcessor();
xmlSource = dataSrc;
xslProcessor.input = xmlSource;
xslProcessor.output = xmlProcessedOutput;
xslProcessor.transform();
 
>I get "The XSL stylesheet document must be free threaded in order to be used with the XSL Template object"
It said what it meant. But for some reason you don't show how you establish xslDoc. It must be loaded into a freethreaded model.
[tt]
var xslDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
with (xslDoc) {
async=false;
load ("[green]someurl[/green]");
[green]//or depending on the source
//loadXML ("someserializedxsldocument");[/green]
}
//etc etc (what is shown)
[/tt]
 
The same is equally applicable for something equally hidden, namely, xmlSource.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top