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

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

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

Post 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">
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply