GNOME Bugzilla – Bug 339222
xsl:param at invalid position inside an xsl:template is not catched
Last modified: 2006-07-14 16:22:43 UTC
Example: cat template.xsl <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:param name="foo"/> <foo/> <xsl:param name="bar"/> </xsl:template> </xsl:stylesheet> xsltproc template.xsl ../test.xml <?xml version="1.0"?> <foo/>
The above invalid second xsl:param is missed to be catched in xsltParseTemplateContent().
Additional issue: Occurences xsl:param deeper in the tree are not checked correctly. xsl:param is only allowed as a top-level element or an immediate child element of xsl:template. The check is performed in xsltStylePreCompute() which calls xsltCheckInstructionElement() which allows xsl:template, xsl:param, xsl:variable, xsl:attribute (and even extension elements) as parents for xsl:param. Example: the following stylesheet should raise an error. "templ-param-2.xsl" <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:param name="foo"> <xsl:param name="bar"/> </xsl:param> <foo/> </xsl:template> </xsl:stylesheet> xsltproc templ-param-2.xsl ..\test.xml <?xml version="1.0"?> <foo/>
Fixed in CVS.