Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Msxml2.FreeThreadedDOMDocument vs. Msxml2.FreeThreadedDOMDocument.3.0 bahavior

From: "Ondrej Pokluda" <archiv.ondrej@-----.-->
To: 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






transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent