RE: [xsl] MSXML3 transformNodeToObject method error

Subject: RE: [xsl] MSXML3 transformNodeToObject method error
From: "Martin Rowlinson \(MarrowSoft\)" <marrow@xxxxxxxxxxxxxx>
Date: Wed, 20 Aug 2003 07:12:44 +0100
Hi Brook,

If you are going to use .transformNodeToObject() you would be well
advised not to specify the second parameter (the output) as an XML DOM
if the stylesheet is producing HTML (i.e. method="html").  This is
because HTML output will often not constitute well-formed XML -
therefore an attempt to push it into an XML DOM will result in an error.

The second parameter of .transformNodeToObject() can also be any object
whose interface supports a .write() method - allowing the output to be
written directly to that object.  In your case, using ASP, you could
specify the Response object, e.g.
     source.transformNodeToObject(stylesheet, Response);


> When I run it, I get this error:
>    The stylesheet does not contain a document element. The stylesheet
> be empty, or it may not be a well-formed XML document.

Sounds like the stylesheet wasn't actually loaded into the DOM
The .load() method returns a boolean result denoting the success of the
load - you'd be as well to check that result ;)

Marrow - home of Xselerator (XSLT IDE and debugger)

 XSL-List info and archive:

Current Thread