PDA

View Full Version : XML not working with ASP


Josh Campbell
01-15-2003, 03:41 AM
I am an XML newbie although I have been using ASP for a while now. I am trying to figure this stuff out so I put together a little sample to test it out and it's not working. The Asp is:

<%
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = false
objXML.load "document.xml"

Set objXSL = Server.CreateObject("Microsoft.XMLDOM")
objXSL.async = false
objXSL.load "document.xsl"

Response.Write(objXML.transformNode(objXSL))

Set objXSL = Nothing
Set objXML = Nothing
%>

The stylesheet looks like:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/2001/XSL/Transform" version="1.1">
<xsl:output method="html" />

<xsl:template match="/">
<xsl:apply-templates select="document" />
</xsl:template>

<xsl:template match="document">
<html>
<body>
<p>
Hi
</p>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

And the XML is:

<?xml version="1.0" standalone="no" ?>
<!DOCTYPE document SYSTEM "document.dtd">

<document>
This text doesn't matter since it doesn't get displays this is just test text.
</document>

Whenever i run the script it says:

msxml3.dll error '80004005'

The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.

I ran it thru Xalan and it came out like it was supposed to (Said Hi) so I know that there's a problem with the ASP. Thanks for any help.

aCcodeMonkey
01-15-2003, 08:02 AM
Josh,

You ran into the same kind of "Bug" that I did earlier this week.

There is problem with MDAC 2.6's installation that can cause this and a few other errors. In my case I have a XP on a multi-processor computer.


You could try installing SP2

MSXML Parser 3.0 Service Pack 2 Release (http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/772/msdncompositedoc.xml)

ServerXMLHTTP Stops Responding When You Send a POST Request (http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B305053)

Hope this helps:cool: