Page 1 of 1

Firefox & XSLT: "An unknown error has occurred ()"

Posted: Mon Jul 26, 2010 4:37 pm
by ^rooker
[PROBLEM]
I was playing around with XML stylesheets, and all over a sudden ran into the following errormessage when opening the XML+XSL in Firefox (v3.0.9 and v3.6.4)
Error loading stylesheet: An unknown error has occurred ()
The statement causing the error was a simple value-of select:

Code: Select all

<xsl:value-of select="@xlink:href"/>
[SOLUTION]
The problem was that I didn't declare the "xlink" namespace in the stylesheet. Firefox could/should have told me about this, but it didn't. :(

The solution is to add the namespace declaration to the XSL file, like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xlink="http://www.w3.org/1999/xlink">