IIS7 ASP Response object incompatible with MSXML transformNodeToObject

Discussion in 'ASP General' started by Anthony Jones, Aug 8, 2008.

  1. People,

    Anyone else got an IIS7 server out there that they can test this little ASP
    file:-

    <%
    Set xml = Server.CreateObject("MSXML2.DOMDocument.3.0")
    xml.loadXML "<root />"

    Set xsl = Server.CreateObject("MSXML2.DOMDocument.3.0")
    xsl.loadXML "<xsl:stylesheet
    xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" version=""1.0"">" & _
    "<xsl:eek:utput method=""xml"" encoding=""UTF-8"" />" & _
    "<xsl:template match=""root""><ok /></xsl:template>" & _
    "</xsl:stylesheet>"

    Response.ContentType = "text/xml"
    Response.CharSet = "UTF-8"
    xml.documentElement.transformNodeToObject xsl, Response

    %>

    The above works fine on IIS6 and below. On IIS7 however it fails with
    0x80004001 Not Implemented on the transformNodeToObject.

    It seems something has changed in either MSXML or ASP that breaks this code.

    Varitions attempted:-

    Use MSXML6: Still Fails
    Set Response.CodePage = 65001: Still fails
    Set encoding in output element to "Windows-1252": Still fails
    Set method to html: Still fails

    Pass a different object that implements IStream: Succeeds.

    Has Response stop implementing IStream use DOMDocument.Save and pass in the
    Response object. That succeeds also so Response still implements IStream.

    I note the MSXML3.dll is SP10 on the 2008 server whereas my MSXML3.dll on
    the 2003 server is SP9.

    Can't find any info on changes though.

    Does anyone have any light to shed or can confirm the problem?

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Aug 8, 2008
    #1
    1. Advertising

  2. Anthony Jones wrote:
    > People,
    >
    > Anyone else got an IIS7 server out there that they can test this
    > little ASP file:-
    >

    Leaves me out ... sorry.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Aug 8, 2008
    #2
    1. Advertising

  3. Anthony Jones wrote:

    > xml.documentElement.transformNodeToObject xsl, Response
    >
    > %>
    >
    > The above works fine on IIS6 and below. On IIS7 however it fails with
    > 0x80004001 Not Implemented on the transformNodeToObject.


    Does it work if you use
    xml.transformNodeToObject xsl, Response
    ?

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Aug 9, 2008
    #3
  4. "Martin Honnen" <> wrote in message
    news:ePpHlJh%...
    > Anthony Jones wrote:
    >
    > > xml.documentElement.transformNodeToObject xsl, Response
    > >
    > > %>
    > >
    > > The above works fine on IIS6 and below. On IIS7 however it fails with
    > > 0x80004001 Not Implemented on the transformNodeToObject.

    >
    > Does it work if you use
    > xml.transformNodeToObject xsl, Response
    > ?
    >



    Martin, Good idea, still doesn't work though. This does appear to be
    specific to the use of transformNodeToObject and the Response object. It
    works when other IStream implementers are passed to transformNodeToObject
    and other methods that are designed to write to an IStream work with the
    Response object.

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Aug 9, 2008
    #4
  5. Anthony Jones wrote:

    >>> xml.documentElement.transformNodeToObject xsl, Response


    >>> The above works fine on IIS6 and below. On IIS7 however it fails with
    >>> 0x80004001 Not Implemented on the transformNodeToObject.



    > This does appear to be
    > specific to the use of transformNodeToObject and the Response object.


    As long as you want to create XML with the transformation you could
    first transform to an MSXML DOM document and then save that to the
    Response object. But writing HTML or plain text as the transformation
    result to the Response object does not seem possible then which is quite
    a breaking change.

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Aug 9, 2008
    #5
  6. "Martin Honnen" <> wrote in message
    news:ey43eWk%...
    > Anthony Jones wrote:
    >
    > >>> xml.documentElement.transformNodeToObject xsl, Response

    >
    > >>> The above works fine on IIS6 and below. On IIS7 however it fails with
    > >>> 0x80004001 Not Implemented on the transformNodeToObject.

    >
    >
    > > This does appear to be
    > > specific to the use of transformNodeToObject and the Response object.

    >
    > As long as you want to create XML with the transformation you could
    > first transform to an MSXML DOM document and then save that to the
    > Response object. But writing HTML or plain text as the transformation
    > result to the Response object does not seem possible then which is quite
    > a breaking change.
    >



    Exactly, code isn't going to migrate to IIS7 without modification.
    Fortunately for myself my real world stuff uses a library so I need only
    tweak the library with a workaround, whenever I can come up with one.

    For others this could be a more painful experience. I'll try to dig down
    further, currently its not clear whether the problem is in SP10 of MSXML or
    IIS7s ASP Response object.

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Aug 9, 2008
    #6
  7. "Anthony Jones" <> wrote in message
    news:%23pjwOeX%...
    > People,
    >
    > Anyone else got an IIS7 server out there that they can test this little

    ASP
    > file:-
    >
    > <%
    > Set xml = Server.CreateObject("MSXML2.DOMDocument.3.0")
    > xml.loadXML "<root />"
    >
    > Set xsl = Server.CreateObject("MSXML2.DOMDocument.3.0")
    > xsl.loadXML "<xsl:stylesheet
    > xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" version=""1.0"">" & _
    > "<xsl:eek:utput method=""xml"" encoding=""UTF-8"" />" & _
    > "<xsl:template match=""root""><ok /></xsl:template>" & _
    > "</xsl:stylesheet>"
    >
    > Response.ContentType = "text/xml"
    > Response.CharSet = "UTF-8"
    > xml.documentElement.transformNodeToObject xsl, Response
    >
    > %>
    >
    > The above works fine on IIS6 and below. On IIS7 however it fails with
    > 0x80004001 Not Implemented on the transformNodeToObject.
    >
    > It seems something has changed in either MSXML or ASP that breaks this

    code.
    >
    > Varitions attempted:-
    >
    > Use MSXML6: Still Fails
    > Set Response.CodePage = 65001: Still fails
    > Set encoding in output element to "Windows-1252": Still fails
    > Set method to html: Still fails
    >
    > Pass a different object that implements IStream: Succeeds.
    >
    > Has Response stop implementing IStream use DOMDocument.Save and pass in

    the
    > Response object. That succeeds also so Response still implements IStream.
    >
    > I note the MSXML3.dll is SP10 on the 2008 server whereas my MSXML3.dll on
    > the 2003 server is SP9.
    >
    > Can't find any info on changes though.
    >
    > Does anyone have any light to shed or can confirm the problem?
    >


    Here is an update on this problem.

    MSXML 3.0 SP10 (msxml3.dll 8.100.1043.0) and MSXML 6.0 SP2 (msxml6.dll
    6.20.1076.0)

    I've only found these on Server 2008 although I haven't checked an XP SP3
    machine or Vista SP1.

    Both of these now call the Commit method on the IStream interface passed to
    the transformNodeToObject method. Previous versions did not do this. The
    Response object of ASP does not implement this method and throws an error
    when asked to do so.

    The work round is to create a Wrapping Implementation of IStream and absorb
    the Commit call.

    :(


    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Aug 13, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mtugnoli

    XSL and transformNodeToObject

    mtugnoli, Mar 27, 2007, in forum: XML
    Replies:
    2
    Views:
    976
    mtugnoli
    Mar 27, 2007
  2. Ray
    Replies:
    1
    Views:
    293
    Martin Honnen
    May 31, 2004
  3. Anthony Jones
    Replies:
    4
    Views:
    225
    Chris
    Dec 19, 2008
  4. tuser
    Replies:
    4
    Views:
    322
    tuser
    Feb 19, 2006
  5. Thomas 'PointedEars' Lahn

    [FYI] MSXML HTTP translates response status code 204 to 1223

    Thomas 'PointedEars' Lahn, Sep 7, 2009, in forum: Javascript
    Replies:
    4
    Views:
    381
    Diego Perini
    Sep 16, 2009
Loading...

Share This Page