[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problems doing XSL Transformation using ASP - SOLV
Folks (Thanks Americo & Mukul for your responses) I am using MSXML 3.0 only. That's not the issue. The issue was I had to use Server.MapPath("dummy.xsl") (and for dummy.xml). Check out MSDN help for Server.MapPath. Apparently "current working directory" is not known even to the ASP. It has to query the Server to resolve the full path of the XML/XSL files. This function Server.MapPath merely KNOWS the CWD so uses it to expand the given file name to FULL PATH. NOTE: it doesn't peform checks on file/directory existence. Interestingly I have seen code snippets using the file names directly in load functions. I believe in their environments AspEnableParentPaths would possibly have a value of TRUE (instead of the default value of FALSE). You'll find this information too on MSDN help for Server.MapPath. ----- Original Message ----- From: "Rangarajan Calyanakoti" <crranga@xxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, October 10, 2003 5:41 PM Subject: Problems doing XSL Transformation using ASP > Folks, > > 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??? > > 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"); > xslt.stylesheet = xslDoc; > var xmlDoc = new ActiveXObject("Msxml2.DOMDocument"); > xmlDoc.async = false; > xmlDoc.resolveExternals = false; > xmlDoc.load("dummy.xml"); > xslProc = xslt.createProcessor(); > xslProc.input = xmlDoc; > xslProc.transform(); > Response.Write(xslProc.output) > %> > > > XML FILE - dummy.xml > ------------ > <?xml version="1.0"?> > <?xml-stylesheet type="text/xsl" href="dummy.xsl"?> > > <DUMMY> > </DUMMY> > > XSL FILE - dummy.xsl > ------------ > <?xml version='1.0'?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:output method="html" indent="yes"/> > > <xsl:template match="/"> > <html> > <h1>Yahoooooooo</h1> > </html> > </xsl:template> > </xsl:stylesheet> > > _________________________________________________________________ > Get McAfee virus scanning and cleaning of incoming attachments. Get Hotmail > Extra Storage! http://join.msn.com/?PAGE=features/es > > > 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
|