[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] MSXML3 transformNodeToObject method error


Subject: Re: [xsl] MSXML3 transformNodeToObject method error
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Wed, 20 Aug 2003 08:12:33 +0100

From: Brook Ellingwood <brook@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [xsl] MSXML3 transformNodeToObject method error
Date: Tue, 19 Aug 2003 15:41:20 -0700

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.

Try wrapping the file paths in Server.MapPath:
source.load(Server.MapPath("test.xml"));
etc.

--

Joe

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords