After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339222 - xsl:param at invalid position inside an xsl:template is not catched
xsl:param at invalid position inside an xsl:template is not catched
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.15
Other All
: Normal normal
: ---
Assigned To: kbuchcik
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-20 20:09 UTC by kbuchcik
Modified: 2006-07-14 16:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kbuchcik 2006-04-20 20:09:37 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/>
Comment 1 kbuchcik 2006-04-24 12:33:02 UTC
The above invalid second xsl:param is missed to be catched in xsltParseTemplateContent().
Comment 2 kbuchcik 2006-04-24 12:47:34 UTC
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/>

Comment 3 kbuchcik 2006-07-14 16:22:43 UTC
Fixed in CVS.