Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Msxml2.FreeThreadedDOMDocument vs. Msxml2.FreeThreadedDOMDocument.3.0 bahavior

From: "Anthony Jones" <Ant@------------.--->
To: NULL
Date: 11/15/2007 11:07:00 PM

"Ondrej Pokluda" <archiv.ondrej@a...> wrote in message
news:e4CGL17JIHA.1324@T......
> 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?

I'm not too sure about all your other questions but to the last, yes its no
longer true.

Its better to use the version 3.0 ProgID.  Msxml3 is ubiquitous on the
current windows platforms and certainly on the currently in support ones.

Sometimes due to poor installers the "version-free" prog IDs are redirected
back to older dlls.  This means that from one client to another the
"version-free" prog ID may end up have slightly different behaviours and
features.  In fact with recent updates of IE the pre version 3 classes have
been killed so its possible that on some clients using the older ProgIDs
could fail altogether.

The "version-free" ProgIDs never point to a version later to 3.0 anyway.


-- 
Anthony Jones - MVP ASP/ASP.NET




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