locked
"Microsoft.XMLDOM" vs "Msxml2.DOMDocument.3.0" RRS feed

  • Question

  • Hello,
    I am new to the Win32 scripting env (coming from UNIX env).
    I have been reviewing info on MSDN for Microsoft's XML Parser and I am very confused. I am working with VBScript and JScript under WSH.
    I see different ways to initiate XML Parser but I don't understand what is the difference between them?
    I see examples such as:

    Code:


    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    var xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
    Set xDoc = New MSXML.DOMDocument
    var srcTree = new ActiveXObject("Msxml2.DOMDocument.5.0");
    Dim xmldom As MSXML2.DOMDocument
    xmldom = New MSXML2.DOMDocument



    Does XLMDOM access the XML Parser in msxml.dll and Msxml2.DOMDocument.5.0 and also MSXML2.DOMDocument?
    Why are there so many different versions?
    Is one better than the other? I have been told to only use XMLDOM and other people have told me I have to use "Msxml2.DOMDocument.3.0". I am doing simple xml doc load and parsing.
    Thanks if someone can un-confuse me!

    Styx
    Wednesday, October 29, 2008 5:37 PM

Answers

  •  Resolved:

    explanation of library versions is discussed on MSDN:

    http://msdn.microsoft.com/en-us/library/ms757837(VS.85).aspx

    Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language[:#]0400; mso-fareast-language[:#]0400; mso-bidi-language[:#]0400;}

    The reference to "Microsoft.XMLDOM" is an older method of instantiating the XML Parser.

    It points to the older library msxml version 2. That is the equivalent of:

    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");   // msxml ver 2

    is the same as:

    var xmlDoc = new ActiveXObject("MSXML.DOMDocument"); // msxml ver 2

     

    This will invoke version 3:

    var xmlDoc = new ActiveXObject("MSXML2.DOMDocument"); // msxml ver 3

     

    This will also invoke version 3:

    var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0"); // msxml ver 3

     

    Version 4:

    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0"); // msxml ver 4

     

     

    Version 5:

    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0 "); // msxml ver 5

     

     

    MSXML can exist with many different versions on a single computer. Some upgrades are overwrites and some are side-by-side.

     

    If for some reason, you need to load a particular library version of MSXML, then you would need to instantiate the instance by pointing directly to that particular library. The following is an example of instantiating an instance of MSXML 6.0:

     

    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");//ver 6

     

    Version 6 is the latest and should be used if it is present on the host machine.
    Thursday, October 30, 2008 8:39 PM

All replies

  •  Resolved:

    explanation of library versions is discussed on MSDN:

    http://msdn.microsoft.com/en-us/library/ms757837(VS.85).aspx

    Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language[:#]0400; mso-fareast-language[:#]0400; mso-bidi-language[:#]0400;}

    The reference to "Microsoft.XMLDOM" is an older method of instantiating the XML Parser.

    It points to the older library msxml version 2. That is the equivalent of:

    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");   // msxml ver 2

    is the same as:

    var xmlDoc = new ActiveXObject("MSXML.DOMDocument"); // msxml ver 2

     

    This will invoke version 3:

    var xmlDoc = new ActiveXObject("MSXML2.DOMDocument"); // msxml ver 3

     

    This will also invoke version 3:

    var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0"); // msxml ver 3

     

    Version 4:

    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0"); // msxml ver 4

     

     

    Version 5:

    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0 "); // msxml ver 5

     

     

    MSXML can exist with many different versions on a single computer. Some upgrades are overwrites and some are side-by-side.

     

    If for some reason, you need to load a particular library version of MSXML, then you would need to instantiate the instance by pointing directly to that particular library. The following is an example of instantiating an instance of MSXML 6.0:

     

    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");//ver 6

     

    Version 6 is the latest and should be used if it is present on the host machine.
    Thursday, October 30, 2008 8:39 PM
  • Thanx azstyx 

    was looking for same answer for quite sometime now. Your answer was very helpful

     

     


    wHy sO sEriOUs......
    Wednesday, November 30, 2011 7:41 AM