Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Msxml2.FreeThreadedDOMDocument vs. Msxml2.FreeThreadedDOMDocument.3.0 bahavior Msxml2.FreeThreadedDOMDocument vs. Msxml2.FreeThreadedDOMDocument.3.0 bahaviorTo: NULL Date: 11/15/2007 8:25:00 PM
Hi all,
for years we used code like (I used now MSDN code, but we used pretty
much the same, there is not much rocket science in using createProcessor)
For test I used createProcessor.xsl from MSDN.
var xslt = new ActiveXObject("Msxml2.XSLTemplate");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
var xslProc;
xslDoc.async = false;
xslDoc.load("createProcessor.xsl");
if (xslDoc.parseError.errorCode != 0) {
var myErr = xslDoc.parseError;
WScript.Echo("You have error " + myErr.reason);
} else {
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
var myErr = xmlDoc.parseError;
WScript.Echo("You have error " + myErr.reason);
} else {
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.addParameter("param1", "Hello");
xslProc.transform();
WScript.Echo(xslProc.output);
}
}
Never problems other than our errors in xsl or xml format.
Suddenly we experienced problem. On *SOME* machines this program failed, so
far never
on English version of windows, always on XP. Error was caused at line
xslt.stylesheet = xslDoc;
We have it in C++ as well so using debugger line
pXSLTmpl->putref_stylesheet(pXSLDoc);
(which is its equivalent in C++ using smart pointers) gives an exception,
but not _com_error, as is usual, but access violation that is caught by
catch (...)
By comparing MSDN code and our code I fugured out that changing
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
into
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
solves problem. I suspect MSXML update causes problem. So my questions are
1. What happened during updates of MSXML, that program stopped to work?
2. What is necessary and sufficient condition that this bahaviour occures?
3. How can we prevent this ?
4. Using version-free coms was considered a good practice for reliable
components.
Is it no longer true?
Thanks for any feedback
Ondrej Pokluda
Compuplast
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
