|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] AW: MSXML3 transformNodeToObject method error
Hi Brook,
maybe the MSXML version is not correct. Try replacing "Msxml2.DOMDocument"
by "Msxml2.DOMDocument.3.0" or "Msxml2.DOMDocument30"
Regards,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de
----------
Von: Brook Ellingwood
Gesendet: Mittwoch, 20. August 2003 00:41
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: MSXML3 transformNodeToObject method error
Hi
I'm having some issues with getting the   character in my XSL to render
in IE for Windows (though, oddly enough, it's working on Mac OS 9!). I could
probably do some sort of cheap escaping trick, but I really want to just be
able to pass the the encoded characters through MSXML untouched. It looks to
me like transformNodeToObject is the way to achieve this.
I've tried cobbling together script on my own without getting it to work,
then I pulled this example from MSDN (I added Response.ContentType and
Response.Charset):
<%@LANGUAGE="JScript"%>
<%
Response.ContentType = "text/HTML"
Response.Charset= "UTF-8"
// Load data.
var source = new ActiveXObject("Msxml2.DOMDocument");
source.async = false;
source.resolveExternals = false;
source.load("test.xml");
// Load style sheet.
var stylesheet = new ActiveXObject("Msxml2.DOMDocument");
stylesheet.async = false;
stylesheet.resolveExternals = false;
stylesheet.load("test.xsl");
// Set up the resulting document.
var result = new ActiveXObject("Msxml2.DOMDocument");
result.async = false;
result.validateOnParse = true;
// Parse results into a result DOM Document.
source.transformNodeToObject(stylesheet, result);
%>
When I run it, I get this error:
The stylesheet does not contain a document element. The stylesheet may
be empty, or it may not be a well-formed XML document.
Well, the stylesheet is fine. Just to be sure, I've stripped it down to
this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<HTML>
<HEAD>
</HEAD>
<BODY>
<xsl:value-of select="./foo" />
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
The way things are going, I'll probably just hit another error once I get
this one resolved, but does anybody know what's going on here?
Source URL for MS code:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/ht
m/xmmthtransformnodetoobject.asp
Thanks,
-- Brook
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








