If your xsl:param arrives empty in Firefox...

Jun 15, 2010 03:33

(This is an xml/xsl geek post for any lost souls who, like me, spent days trying to figure out the problem. If that's not you then move along.)

I've been working on extremely technical (like you wouldn't believe) XSL which worked fine in xsltproc (which at least gives some error messages) but failed in firefox because the parameter arrived blank. The best way to explain it is by example.

Given the simple XML:

and the stylesheet that passes parameters:

Called from Branch

Called from Branch/Leaf

Leaf: []

In short, from the Root node, Leaf gets matched - once having selected "Branch" and once with "Branch/Leaf". The results are:

Leaf: []
Leaf: [Called from Branch/Leaf]

As you can see, when the selection is not an immediate match (ie it's a level or more down) then the parameter's value is lost. Firefox are aware of this but frankly don't care so if your parameters are disappearing, use to see where you are and make sure have selected all the way down.
Previous post Next post
Up