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

M

Matt

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>
 
M

Mark Schupp

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top