xsl-list
[Top] [All Lists]

Re: Problems doing XSL Transformation using ASP

2003-10-11 21:21:26
Oops ... I am just a beginner and have been involved with XML/XSL for the
past 2 weeks.  If you find out please do let me/us know.

BTW, Msxml2.FreeThreadedDOMDocument[.x.y] ... where x.y could be 3.0, 4.0.
If you drop it, system picks up the default MSXML DLL.  Else you may specify
which one to use.  If I didn't specify the version explicitly, I would be
using 3.0 as that's the version of MSXML installed on my machine.  That
might not be true if your machine only has, say, MSXML 2.0.  And you are
right 2.0 was WD-XSL version of MSXML and 3.0 and 4.0 are later version and
are compliant with XSL/Transform.  Check out the initial dry (not quite)
pages of MSDN help (http://msdn.microsoft.com/library) for MSXML3.0 and
MSXML4.0

But your question is legit!  What is this MSXML2???


----- Original Message -----
From: "Mukul Gandhi" <mukulgw3(_at_)yahoo(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Saturday, October 11, 2003 8:02 AM
Subject: RE: [xsl] Problems doing XSL Transformation using ASP


Sorry I did'nt knew Msxml2 is MSXML3. I applied the
XSL to XML *without changing anything* with MSXML3
(not through ASP but with xmlspy) on Win2K. The
transformation succedded.

I am curious, if you know the answer -- What does the
number "2" signify in Msxml2.DomDocument ?

Regards,
Mukul


--- Americo_Albuquerque <melinor(_at_)zmail(_dot_)pt> wrote:

No Rangarajan is using MSXML3. Msxml2.DomDocument is
MSXML3.

The error reported says: msxml3.dll error '80004005'
Also an evidance that he is using MSXML3

(...)

I have a very simple XML, XSL file and a very
simple
ASP file to perform the
XSL Transformation on the XML file using the XSL
file and providing it to
any client browswer.  I get the following error.

NOTE: If I open the xml file (that is just from
the
client side) it works
just fine!

What am I missing???

Check if your dummy.xsl is in the same directory as
the asp file
Open the dummy.xsl in IE to see if it is well formed


ERROR
---------

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.

/test/vqtreport.asp, line 9


ASP FILE - dummy.asp
------------
<%@ language=javascript %>
<%
   var xslt = new
ActiveXObject("Msxml2.XSLTemplate");
   var xslDoc = new
ActiveXObject("Msxml2.FreeThreadedDOMDocument");
   var xslProc;
   xslDoc.async = false;
   xslDoc.resolveExternals = false;
   xslDoc.load("dummy.xsl");
Change this to:
xslDoc.load(Server.MapPath("dummy.xsl"));
Sometimes asp as a little trouble in finding the
files

Add here:
       if(xslDoc.parseError.errorCode!=0) {
         response.write("Stylesheet error:<br>");
         response.write("Error: " +
xslDoc.parseError.errorCode +
"<br>");
         response.write("Reason: " +
xslDoc.parseError.reason + "<br>");
         response.write("Line: " +
xslDoc.parseError.line + "<br>");
         response.write("Char position: " +
xslDoc.parseError.linepos +
"<br>");
         response.write("Source: " +
xslDoc.parseError.srcText +
"<br>");
       }

This will report your error with more accuracy

   xslt.stylesheet = xslDoc;
   var xmlDoc = new
ActiveXObject("Msxml2.DOMDocument");
   xmlDoc.async = false;
   xmlDoc.resolveExternals = false;
   xmlDoc.load("dummy.xml");

You might want to do the same here. Just copy the
above code and change
xslDoc by xmlDoc

   xslProc = xslt.createProcessor();
   xslProc.input = xmlDoc;
   xslProc.transform();
   Response.Write(xslProc.output)
%>
(...)

Regards,
Americo Albuquerque


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



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



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