Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    <http://www.quirksmode. org/book/printable/xmlhttp.txtshow s two
    alternatives to Microsoft.XMLHT TP - Msxml2.XMLHTTP and Msxml3.XMLHTTP.
    If my understanding is correct, the different numbers refer to the
    version of Microsoft's XML parser and that Microsoft.XMLHT TP refers to
    the latest installed version.

    This makes me wonder why sites like
    <http://developer.apple .com/internet/webcontent/xmlhttpreq.html opt to
    use Msxml2.XMLHTTP, first, and then use Microsoft.XMLHT TP as a
    fallback. If v2 was the latest version of the XML parser,
    Microsoft.XMLHT TP would refer to it just as Msxml2.XMLHTTP does. If v3
    or v4 were the latest versions, Microsoft.XMLHT TP would refer to either
    of those. So why give v2 preference? Wouldn't it be better to use v4
    and then v3, before using v2? Wouldn't it be better just to reference
    Microsoft.XMLHT TP and not Msxml*.XMLHTTP?

  • Julian Turner

    #2
    Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


    yawnmoth wrote:
    <http://www.quirksmode. org/book/printable/xmlhttp.txtshow s two
    alternatives to Microsoft.XMLHT TP - Msxml2.XMLHTTP and Msxml3.XMLHTTP.
    If my understanding is correct, the different numbers refer to the
    version of Microsoft's XML parser and that Microsoft.XMLHT TP refers to
    the latest installed version.
    >
    This makes me wonder why sites like
    <http://developer.apple .com/internet/webcontent/xmlhttpreq.html opt to
    use Msxml2.XMLHTTP, first, and then use Microsoft.XMLHT TP as a
    fallback. If v2 was the latest version of the XML parser,
    Microsoft.XMLHT TP would refer to it just as Msxml2.XMLHTTP does. If v3
    or v4 were the latest versions, Microsoft.XMLHT TP would refer to either
    of those. So why give v2 preference? Wouldn't it be better to use v4
    and then v3, before using v2? Wouldn't it be better just to reference
    Microsoft.XMLHT TP and not Msxml*.XMLHTTP?
    Hi

    I don't know what the correct answer to this is, but you should have a
    look at tbe MS XML Web Log as to the recommended ProgIDs at the moment.

    <URL:http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx>


    Regards


    Julian Turner

    Comment

    • Julian Turner

      #3
      Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


      Julian Turner wrote:
      [snip]
      I don't know what the correct answer to this is, but you should have a
      look at tbe MS XML Web Log as to the recommended ProgIDs at the moment.
      >
      <URL:http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx>
      >

      See the following quote at the end of the above entry:-

      "MSXML2 vs. Microsoft namespace - I've also seen a lot of code that
      instantiates the "Microsoft.XMLH TTP" ActiveX object rather than the
      MSXML2.XMLHTTP. 3.0 or MSXML2.XMLHTTP. 6.0 if you're using 6.0. The
      "Microsoft" namespace is actually older and is only implemented in
      MSXML3 for legacy support. It's unfortunate we used the "better"
      name on the older version, but stick to the "msxml2" namespace when
      instantiating objects."

      Seems to suggest that using Microsoft.XMLHT TP is actually out of date.

      Regards

      Julian

      Comment

      • VK

        #4
        Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


        Julian Turner wrote:
        Seems to suggest that using Microsoft.XMLHT TP is actually out of date.
        Right: that is for the very first implementations of IXMLHTTPRequest so
        should be used (if even used) as the last option.

        For modern implementations it is Msxml library activated by
        Msxml2.XMLHTTP or Msxml3.XMLHTTP etc.

        As it can be very problematic to detect the current version of the
        library (2?, 3?,..., 6?) Microsoft made "Msxml2.XMLHTTP " to be the
        universal alias *for the current library on the given client* This way
        you can use new ActiveXObject(' Msxml2.XMLHTTP' ) and do not worry that
        the current livrary version is say Msxml4

        Comment

        • Martin Honnen

          #5
          Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP

          VK wrote:
          For modern implementations it is Msxml library activated by
          Msxml2.XMLHTTP or Msxml3.XMLHTTP etc.
          There is no program id 'Msxml3.XMLHTTP '. If you want to use the client
          side XMLHTTP component of MSXML 3 then the program id is
          'Msxml2.XMLHTTP .3.0'. For MSXML 4 it is 'Msxml2.XMLHTTP .4.0', for MSXML
          5 it is 'Msxml2.XMLHTTP .5.0', and for MSXML 6 it is 'Msxml2.XMLHTTP .6.0'.
          See
          <http://msdn.microsoft. com/library/default.asp?url =/library/en-us/xmlsdk/html/e5533515-e525-4781-b68b-1ecfefdd1e89.as p>
          for the MSXML 3 program ids and
          <http://msdn.microsoft. com/library/default.asp?url =/library/en-us/xmlsdk/html/5016cf75-4358-4c1f-912e-c071aa0a0991.as p>
          for the introduction to that section.
          As it can be very problematic to detect the current version of the
          library (2?, 3?,..., 6?) Microsoft made "Msxml2.XMLHTTP " to be the
          universal alias *for the current library on the given client* This way
          you can use new ActiveXObject(' Msxml2.XMLHTTP' ) and do not worry that
          the current livrary version is say Msxml4
          That is not true, MSXML 4 and later components can only be instantiated
          with version specific program ids e.g. 'Msxml2.XMLHTTP .4.0'.
          To quote from above URL:
          "After you install MSXML 4.0 or later, applications that use
          version-independent ProgIDs continue to run using the most recent
          version of MSXML prior to version 4.0. Typically, for most current
          Windows systems, this will be MSXML 3.0"

          So the version independent version id 'Msxml2.XMLHTTP ' is bound to MSXML
          3 or earlier but never to later versions (MSXML 4 or later) even if
          these are installed.


          --

          Martin Honnen

          Comment

          • VK

            #6
            Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP

            Martin Honnen wrote:
            That is not true, MSXML 4 and later components can only be instantiated
            with version specific program ids e.g. 'Msxml2.XMLHTTP .4.0'.
            To quote from above URL:
            "After you install MSXML 4.0 or later, applications that use
            version-independent ProgIDs continue to run using the most recent
            version of MSXML prior to version 4.0. Typically, for most current
            Windows systems, this will be MSXML 3.0"
            >
            So the version independent version id 'Msxml2.XMLHTTP ' is bound to MSXML
            3 or earlier but never to later versions (MSXML 4 or later) even if
            these are installed.
            Right, sorry and thanks for the correction. If it is necessary to use
            Microsoft XML Core Services ver.4 or above (say for specific XSLT
            transformations client-side) it is necessary to use the correct ProgID.

            If it is a regular ajaxoid used just to grab data / send data to the
            server than the version is not important and ProgID 'Msxml2.XMLHTTP '
            covers it all.

            Comment

            • yawnmoth

              #7
              Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


              Martin Honnen wrote:
              <snip>
              There is no program id 'Msxml3.XMLHTTP '. If you want to use the client
              side XMLHTTP component of MSXML 3 then the program id is
              'Msxml2.XMLHTTP .3.0'. For MSXML 4 it is 'Msxml2.XMLHTTP .4.0', for MSXML
              5 it is 'Msxml2.XMLHTTP .5.0', and for MSXML 6 it is 'Msxml2.XMLHTTP .6.0'.
              If there's no Msxml3.XMLHTTP program id, I assume that means that
              <http://www.quirksmode. org/book/printable/xmlhttp.txtis in error when
              it references it?

              Also, I assume the program id for the client side XMLHTTP component of
              MSXML 1 is Microsoft.XMLHT TP?
              That is not true, MSXML 4 and later components can only be instantiated
              with version specific program ids e.g. 'Msxml2.XMLHTTP .4.0'.
              To quote from above URL:
              "After you install MSXML 4.0 or later, applications that use
              version-independent ProgIDs continue to run using the most recent
              version of MSXML prior to version 4.0. Typically, for most current
              Windows systems, this will be MSXML 3.0"
              >
              So the version independent version id 'Msxml2.XMLHTTP ' is bound to MSXML
              3 or earlier but never to later versions (MSXML 4 or later) even if
              these are installed.
              Does Msxml2.XMLHTTP bind itself to MSXML 1, as well?

              If so, what's the point of referencing Microsoft.XMLHT TP at all?
              Shouldn't Msxml2.XMLHTTP always exist when Microsoft.XMLHT TP does?

              If not, then would it be more accurate to say that Msxml2.XMLHTTP is
              bound to MSXML 2 and 3?

              Finally, if one wanted to use the latest version of MSXML (even though
              it might not be necessary), I assume the program id's ought to be
              checked in this order?:

              Msxml2.XMLHTTP. 6.0
              Msxml2.XMLHTTP. 5.0
              Msxml2.XMLHTTP. 4.0
              Msxml2.XMLHTTP
              (assuming Msxml2.XMLHTTP is not bound to MSXML 1) Microsoft.XMLHT TP

              Comment

              • Martin Honnen

                #8
                Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP

                yawnmoth wrote:
                If there's no Msxml3.XMLHTTP program id, I assume that means that
                <http://www.quirksmode. org/book/printable/xmlhttp.txtis in error when
                it references it?
                It does not help having that in there as that program id does not exist
                but as the code that uses it has try/catch the script will not give an
                error but rather go on and create a different component.

                what's the point of referencing Microsoft.XMLHT TP at all?
                Original IE 5 and IE 5.5 installation have MSXML versions that support
                that program id but not the program id Msxml2.XMLHTTP.

                For all the details I have already pointed to
                <http://msdn.microsoft. com/library/default.asp?url =/library/en-us/xmlsdk/html/5016cf75-4358-4c1f-912e-c071aa0a0991.as p>
                then there was already a link posted to a recent blog entry of the MS
                XML team on what they want to be used currently.
                Finally this knowledge base entry
                <http://support.microso ft.com/kb/269238/en-us>
                lists the different versions and which versions are or were included
                with which other products (e.g. IE versions).




                --

                Martin Honnen

                Comment

                • Joe D Williams

                  #9
                  Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP

                  >
                  >what's the point of referencing Microsoft.XMLHT TP at all?
                  >
                  Original IE 5 and IE 5.5 installation have MSXML versions that support
                  that program id but not the program id Msxml2.XMLHTTP.
                  >
                  For all the details I have already pointed to
                  <http://msdn.microsoft. com/library/default.asp?url =/library/en-us/xmlsdk/html/5016cf75-4358-4c1f-912e-c071aa0a0991.as p>
                  then there was already a link posted to a recent blog entry of the MS XML
                  team on what they want to be used currently.
                  Finally this knowledge base entry
                  <http://support.microso ft.com/kb/269238/en-us>
                  lists the different versions and which versions are or were included with
                  which other products (e.g. IE versions).
                  >
                  >
                  So from what I can see, this should cover reasonable possiblilities?

                  // create XMLHttpRequest request
                  function createXMLHttpRe quest()
                  {
                  if ( window.XMLHttpR equest ) // IE7 and all of interest
                  {
                  try { return new window.XMLHttpR equest(); }
                  catch(e) {alert("window. XMLHttpRequest failed"+e.messa ge);}
                  }
                  else // old IE
                  {
                  try { return new ActiveXObject(" Microsoft.XMLHT TP"); }
                  catch (e) {}
                  try { return new ActiveXObject(" Msxml2.XMLHTTP" ); }
                  catch (e) {alert("Platfor m not supported"+e.me ssage);}
                  }
                  }

                  The only 'problem' being that the window.XMLHttpR equest
                  seems to work slightlly diferent in IE7 than others by not
                  allowing local rurl.

                  Thanks and Best Regards,
                  Joe


                  Comment

                  • yawnmoth

                    #10
                    Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


                    Joe D Williams wrote:
                    <snip>
                    So from what I can see, this should cover reasonable possiblilities?
                    >
                    // create XMLHttpRequest request
                    function createXMLHttpRe quest()
                    {
                    if ( window.XMLHttpR equest ) // IE7 and all of interest
                    {
                    try { return new window.XMLHttpR equest(); }
                    catch(e) {alert("window. XMLHttpRequest failed"+e.messa ge);}
                    }
                    else // old IE
                    {
                    try { return new ActiveXObject(" Microsoft.XMLHT TP"); }
                    catch (e) {}
                    try { return new ActiveXObject(" Msxml2.XMLHTTP" ); }
                    catch (e) {alert("Platfor m not supported"+e.me ssage);}
                    }
                    }
                    Per this discussion, it seems that it'd be better to use
                    Microsoft.XMLHT TP only if Msxml2.XMLHTTP is unavailable (you're doing
                    it in the other direction), since Microsoft.XMLHT TP refers to an older
                    version of Microsoft's XML Core Services then is Msxml2.

                    Comment

                    • yawnmoth

                      #11
                      Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


                      Martin Honnen wrote:
                      yawnmoth wrote:
                      >
                      If there's no Msxml3.XMLHTTP program id, I assume that means that
                      <http://www.quirksmode. org/book/printable/xmlhttp.txtis in error when
                      it references it?
                      >
                      It does not help having that in there as that program id does not exist
                      but as the code that uses it has try/catch the script will not give an
                      error but rather go on and create a different component.
                      >
                      >
                      what's the point of referencing Microsoft.XMLHT TP at all?
                      >
                      Original IE 5 and IE 5.5 installation have MSXML versions that support
                      that program id but not the program id Msxml2.XMLHTTP.
                      >
                      For all the details I have already pointed to
                      <http://msdn.microsoft. com/library/default.asp?url =/library/en-us/xmlsdk/html/5016cf75-4358-4c1f-912e-c071aa0a0991.as p>
                      No page on that URL seems to discuss Microsoft.XMLHT TP request very
                      much.

                      <http://msdn.microsoft. com/library/en-us/xmlsdk/html/e5533515-e525-4781-b68b-1ecfefdd1e89.as p?frame=true>
                      suggests that Microsoft.XMLHT TP is bound MSXML 2. It makes no mention
                      of whether or not Msxml2.XMLHTTP is also bound to MSXML 2 (which would
                      mean that two things would be bound to it), let alone whether or not
                      it's bound to MSXML 1.

                      <http://msdn.microsoft. com/library/en-us/xmlsdk/html/5016cf75-4358-4c1f-912e-c071aa0a0991.as p>
                      suggests that MSXML 3 was the last one that had a version-independent
                      ProgID but doesn't state what the first version of MSXML to support a
                      version-independant ProgID was.

                      Comment

                      • VK

                        #12
                        Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


                        Joe D Williams wrote:
                        The only 'problem' being that the window.XMLHttpR equest
                        seems to work slightlly diferent in IE7 than others by not
                        allowing local rurl.
                        IXMLHTTPRequand (Microsoft) does work just fine with local files -
                        where allowed by the security environment, of course; but for them the
                        status code is reported 0 and not 200. This way the regular "Web check"
                        if (req.status == 200)
                        fails. To make an ajaxoid able to work with Web requests and with local
                        files the check has to be:
                        if ( (req.status == 200) || (req.status == 0) )

                        Comment

                        • Joe D Williams

                          #13
                          Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP


                          "yawnmoth" <terra1024@yaho o.comwrote in message
                          news:1162927909 .509185.108790@ f16g2000cwb.goo glegroups.com.. .
                          >
                          Joe D Williams wrote:
                          ><snip>
                          >So from what I can see, this should cover reasonable possiblilities?
                          >>
                          >// create XMLHttpRequest request
                          >function createXMLHttpRe quest()
                          >{
                          > if ( window.XMLHttpR equest ) // IE7 and all of interest
                          > {
                          > try { return new window.XMLHttpR equest(); }
                          >catch(e) {alert("window. XMLHttpRequest failed"+e.messa ge);}
                          > }
                          > else // old IE
                          > {
                          > try { return new ActiveXObject(" Microsoft.XMLHT TP"); }
                          >catch (e) {}
                          > try { return new ActiveXObject(" Msxml2.XMLHTTP" ); }
                          >catch (e) {alert("Platfor m not supported"+e.me ssage);}
                          > }
                          >}
                          >
                          Per this discussion, it seems that it'd be better to use
                          Microsoft.XMLHT TP only if Msxml2.XMLHTTP is unavailable (you're doing
                          it in the other direction), since Microsoft.XMLHT TP refers to an older
                          version of Microsoft's XML Core Services then is Msxml2.
                          >
                          Thanks, i think I agree. Since IE7 will work with just window.XMLHttpR equest
                          I'm guessing it uses the latest available.
                          Thanks,
                          Joe



                          Comment

                          • Matt Kruse

                            #14
                            Re: Msxml*.XMLHTTP vs. Microsoft.XMLHT TP

                            Joe D Williams wrote:
                            So from what I can see, this should cover reasonable possiblilities?
                            // create XMLHttpRequest request
                            function createXMLHttpRe quest()
                            ...
                            I use this, which seems a little more robust:

                            /**
                            * Returns an XMLHttpRequest object, either as a core object or an ActiveX
                            * implementation. If an object cannot be instantiated, it will return null;
                            * @returns {Object} An XMLHttpRequest object
                            */
                            AjaxRequest.get XmlHttpRequest = function() {
                            if (window.XMLHttp Request) {
                            return new XMLHttpRequest( );
                            }
                            else if (window.ActiveX Object) {
                            // Based on http://jibbering.com/2002/4/httprequest.html
                            /*@cc_on @*/
                            /*@if (@_jscript_vers ion >= 5)
                            try {
                            return new ActiveXObject(" Msxml2.XMLHTTP" );
                            } catch (e) {
                            try {
                            return new ActiveXObject(" Microsoft.XMLHT TP");
                            } catch (E) {
                            return null;
                            }
                            }
                            @end @*/
                            }
                            else {
                            return null;
                            }
                            };


                            --
                            Matt Kruse




                            Comment

                            Working...