Re: [xsl] Testing with MSXML 3.0 or MSXML 6.0 (WAS: XSL 2.0 and .NET and VB)

Subject: Re: [xsl] Testing with MSXML 3.0 or MSXML 6.0 (WAS: XSL 2.0 and .NET and VB)
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 02 Jul 2007 19:55:33 +0200
Robert Koberg wrote:
On Mon, 2007-07-02 at 09:08 -0600, M. David Peterson wrote:
On Mon, 02 Jul 2007 06:47:26 -0600, Manfred Staudinger <manfred.staudinger@xxxxxxxxx> wrote:

The other consideration was, should I upgrade to MSXML6 ? Sure I should,
but when ? Would this mean to lose the ability to test with MSXML3 ?
You see, many question marks, few if any answers (from MS).
Just noticed that the source for the msxsl.exe utility is now available > http://www.microsoft.com/downloads/details.aspx?FamilyId=2FB55371-C94E-4373-B0E9-DB4816552E41&displaylang=en

Not sure if this will be of any help, but never noticed the source was available before now. Something new? Well, regardless, this should be easy enough to hack into specifying which version of MSXML to use during the transformation.

How about:


var versions = ["Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.5.0",
"Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", ,
"MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"];

for (var i=0; i < versions.length; i++) {
  try {
    new ActiveXObject(versions[i]);
    alert("Using: " + versions[i]);
    break;
  } catch (e) {}
}

This is a way to specify by code the object with the highest version number. As from my earlier post, Microsoft strongly discourages to use anything else but version 6.0 or version 3.0. Specifying "MSXML2.DOMDocument" will result in the same object instantiated as when specifying "MSXML2.DOMDocument.3.0", meaning those are redundant. ProgIDs not starting with MSXML2 (i.e., very old versions), are disabled in the browser as a result of security problems.


But this code will not show you what the default is on your system (which is the one chosen when using a PI). MD already showed how to determine that. Changing the default can only be done on the client machine by changing some parameters in the registry. It's been a long time that I changed ProgID related parameters by hand, I don't remember off hand how that was done, but it shouldn't be too hard.

About the "default". If I understand the referred blog entry correctly, the default is used when you don't instantiate the object by code (i.e., with a PI the default will be chosen, which is MSXML6 in the case of IE7 on Vista, the rest MSXML3). When you do instantiate the object by javascript code, there is no way (unless when you have access to the local system) to determine what actually *is* the default, because when you specify the activex object without version in the progid, in all cases, MSXML3 is chosen and not necessarily the default on your system.

I got this information from microsoft and msdn, and I did not verify every bit of it myself. I used to use MSXML6 myself, but there are security restrictions that are hard or uneasy to work around (and too insensible if you ask me), so some time last year I refactored everything back to MSXML3 (rule of lowest common divisor ;)

Cheers,
-- Abel

Current Thread