Subject: RE: Problems doing XSL Transformation using ASP
From: Americo Albuquerque <melinor@xxxxxxxx>
Date: Sat, 11 Oct 2003 11:12:50 +0100
|
Hi
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Mukul Gandhi
> Sent: Saturday, October 11, 2003 3:38 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: Problems doing XSL Transformation using ASP
>
>
> The XSL file you posted, when applied to the XML,
> _works fine with MSXML3.0_ . From your code, it looks
> to me that you are using MSXML2.0 . MSXML2.0 does not
> conform to the official W3C XSL Recommendation. I
> guess MSXML2.0 supports the _W3C XSL Working Draft_ .
>
> But _MSXML3.0 supports W3C XSLT 1.0 and the W3C XPath
> 1.0 Recommendations_. If you can try with MSXML3.0, I
> think the problem will be solved. Or you can try with
> MSXML4.0. It also supports W3C Recommendations..
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
|