asp using xslt error: msxml3.dll (0x80004005)

Discussion in 'ASP General' started by Matt, Apr 10, 2004.

  1. Matt

    Matt Guest

    This xslttest.asp will call xmldata.xml and table.xsl to output table.html.
    However, it has the following run-time error on code:

    xml.transformNodeToObject xsl, ofile 'produces UTF-8:

    Error Type:
    msxml3.dll (0x80004005)
    The stylesheet does not contain a document element. The stylesheet may be
    empty, or it may not be a well-formed XML document.

    Any ideas? Thanks!!

    //----------------------------
    xslttest.asp -----------------------------------------------
    <%
    Set xml = CreateObject("Msxml2.DOMDocument")
    Set xsl = CreateObject("Msxml2.DOMDocument")
    xml.async = False
    xsl.async = false
    xml.Load "xmldata.xml"
    xsl.Load "table.xsl"
    set ofile = CreateObject("ADODB.Stream")
    ofile.Type = 2
    ofile.Charset = "Windows-1252"
    ofile.LineSeparator = -1
    ofile.open
    xml.transformNodeToObject xsl, ofile 'produces UTF-8
    ofile.SaveToFile "table.html", 2
    %>

    //------------------------------
    xmldata.xml ----------------------------------------------
    <?xml version="1.0"?>
    <level1>
    <level2>
    <level3>
    <name>name1</name>
    <value>value1</value>
    </level3>
    <level3>
    <name>name2</name>
    <value>value2</value>
    </level3>
    </level2>
    <level2>
    <level3>
    <name>name3</name>
    <value>value3</value>
    </level3>
    </level2>
    </level1>

    //-----------------------------------
    table.xsl --------------------------------------------
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ms="urn:schemas-microsoft-com:xslt">

    <xsl:eek:utput method="html" encoding="UTF-8" indent="yes" />

    <xsl:template match="/">
    <html>
    <body>
    <table>

    <xsl:for-each select="//level3">
    <tr>
    <td><xsl:value-of select="name" /></td>
    <td><xsl:value-of select="value" /></td>
    </tr>
    </xsl:for-each>

    </table>
    </body>
    </html>
    </xsl:template>

    </xsl:stylesheet>
     
    Matt, Apr 10, 2004
    #1
    1. Advertising

  2. Matt

    Mark Schupp Guest

    open the xsl file directly with IE. That will usually give you a clue to the
    error. also make sure that you have the correct url to the xsl file.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Matt" <> wrote in message
    news:...
    > This xslttest.asp will call xmldata.xml and table.xsl to output

    table.html.
    > However, it has the following run-time error on code:
    >
    > xml.transformNodeToObject xsl, ofile 'produces UTF-8:
    >
    > Error Type:
    > msxml3.dll (0x80004005)
    > The stylesheet does not contain a document element. The stylesheet may be
    > empty, or it may not be a well-formed XML document.
    >
    > Any ideas? Thanks!!
    >
    > //----------------------------
    > xslttest.asp -----------------------------------------------
    > <%
    > Set xml = CreateObject("Msxml2.DOMDocument")
    > Set xsl = CreateObject("Msxml2.DOMDocument")
    > xml.async = False
    > xsl.async = false
    > xml.Load "xmldata.xml"
    > xsl.Load "table.xsl"
    > set ofile = CreateObject("ADODB.Stream")
    > ofile.Type = 2
    > ofile.Charset = "Windows-1252"
    > ofile.LineSeparator = -1
    > ofile.open
    > xml.transformNodeToObject xsl, ofile 'produces UTF-8
    > ofile.SaveToFile "table.html", 2
    > %>
    >
    > //------------------------------
    > xmldata.xml ----------------------------------------------
    > <?xml version="1.0"?>
    > <level1>
    > <level2>
    > <level3>
    > <name>name1</name>
    > <value>value1</value>
    > </level3>
    > <level3>
    > <name>name2</name>
    > <value>value2</value>
    > </level3>
    > </level2>
    > <level2>
    > <level3>
    > <name>name3</name>
    > <value>value3</value>
    > </level3>
    > </level2>
    > </level1>
    >
    > //-----------------------------------
    > table.xsl --------------------------------------------
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > xmlns:ms="urn:schemas-microsoft-com:xslt">
    >
    > <xsl:eek:utput method="html" encoding="UTF-8" indent="yes" />
    >
    > <xsl:template match="/">
    > <html>
    > <body>
    > <table>
    >
    > <xsl:for-each select="//level3">
    > <tr>
    > <td><xsl:value-of select="name" /></td>
    > <td><xsl:value-of select="value" /></td>
    > </tr>
    > </xsl:for-each>
    >
    > </table>
    > </body>
    > </html>
    > </xsl:template>
    >
    > </xsl:stylesheet>
    >
    >
    >
    >
     
    Mark Schupp, Apr 12, 2004
    #2
    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. Jim
    Replies:
    0
    Views:
    4,880
  2. Nigel Murdoch

    msxml3.dll error 80072ee7

    Nigel Murdoch, Oct 1, 2003, in forum: ASP General
    Replies:
    2
    Views:
    396
    Ray at
    Oct 2, 2003
  3. shubha

    error message msxml3.dll (0x800C0005)

    shubha, Jan 14, 2004, in forum: ASP General
    Replies:
    0
    Views:
    179
    shubha
    Jan 14, 2004
  4. msxml3.dll error '80072efd'

    , Dec 21, 2004, in forum: ASP General
    Replies:
    3
    Views:
    530
    Bob Barrows [MVP]
    Dec 21, 2004
  5. Mike

    msxml3.dll error '80070005'

    Mike, Sep 5, 2008, in forum: ASP General
    Replies:
    8
    Views:
    543
    Evertjan.
    Jan 11, 2010
Loading...

Share This Page