PDA

View Full Version : Error loading stylesheet: Parsing an XPath expression failed


Blaher
07-02-2007, 12:14 PM
I'm making a sitemap xsl file.
http://blahertech.dnsalias.net/_dev/sitemap.php
when I load it in a browser, I get "Error loading stylesheet: Parsing an XPath expression failed". I'm guessing most likely it's a error in the xsl file and not the xml file. This is a little harder to find since if I go to the xsl file, it won't show a error. So I don't really know what the bug is.

I don't know much about Xpath either, so I'm not sure what even the parsing error means.

If you want to quickly go to the xsl file it's at:
http://blahertech.dnsalias.net/_dev/templates/xsl.php
(firefox will ask to save it though since it's mime type is application/xsl+xml)

Any help, and I would be grateful.

Arbitrator
07-04-2007, 05:16 AM
I'm making a sitemap xsl file.
http://blahertech.dnsalias.net/_dev/sitemap.php
when I load it in a browser, I get "Error loading stylesheet: Parsing an XPath expression failed". I'm guessing most likely it's a error in the xsl file and not the xml file. This is a little harder to find since if I go to the xsl file, it won't show a error. So I don't really know what the bug is.I don’t think that $location is a correct XPath reference. Perhaps that was supposed to be parsed by the server as PHP?

And yes, you’re correct: the error is in the XSLT file.

I don't know much about Xpath either, so I'm not sure what even the parsing error means.That means that the browser read your XSLT file and it found an error while processing the file. Unfortunately, the message is rather generic and doesn’t tell you anything except to look for errors in your XPath code.

(firefox will ask to save it though since it's mime type is application/xsl+xml)I’m not sure why you’re using the media type application/xsl+xml. The most correct media type is application/xml until application/xslt+xml (http://www.w3.org/TR/xslt20/#xslt-mime-definition) gets approved.

You may as well use the text/xsl media type that both Firefox and Internet Explorer recognize until Internet Explorer supports application/xml or application/xslt+xml is approved and both browsers et al support it.