Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl and xml problem when loading into asp page.

Status
Not open for further replies.

Jacqui1811

Programmer
Jul 8, 2002
100
SG
When I run an asp page that uses an xml file and an xsl file I get the following message:

Error Type:
msxml2.dll (0x80004005)
The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.
/xmlTest/links.asp, line 71

Both the pages are in the same directory as the asp page and are part of a virtual web site.

I have the below code in my asp page loading the documents.
<%
dim objDoc
dim objStylesheet

set objDoc = server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
set objStylesheet = server.CreateObject(&quot;Microsoft.XMLDOM&quot;)

objDoc.async=&quot;false&quot;
objStylesheet.async=&quot;false&quot;

objDoc.load server.mappath(&quot;links.xml&quot;)
objStylesheet.load server.mappath(&quot;links.xsl&quot;)

response.write (objDoc.transformNode(objStylesheet))

%>

The xsl and xml sheets are displaying okay when I load them into the browser on their own so they are well formed.

I have

Can anyone help me ?
Thanks
J
 
If you are using IE5.x the version of MSXML that you are viewing them with is version 2. It looks like you are trying to transform with version 3+. These are much more compliant with the XSL and XSLT specification. Try loading the XSLT into a dowloaded version of XML Spy trail and see what that says. Otherwise could you post the XSL. I had this issue last week and I changed my XSLT and got it to work no probs so I should be able to spot it.

James :) James Culshaw
james@miniaturereview.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top