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 160402 - Compiles invalid XSLT; with-param in template
Compiles invalid XSLT; with-param in template
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.11
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-12-04 01:32 UTC by Frans Englich
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Frans Englich 2004-12-04 01:32:34 UTC
Please describe the problem:

This stylesheet:

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

    <xsl:template match="/">
        <xsl:with-param name="ads">foo</xsl:with-param>
        <foo/>
    </xsl:template>

</xsl:stylesheet>

Gives a result of:
<?xml version="1.0"?>
<foo/>

While it should fail to compile, AFAICT; with-param is not allowed in template
element.

It is not totally unnoticed, xsltproc prints:
xsltApplyOneTemplate: problem with xsl:with-param

But it should bail out, and say something like "Failed to compile: invalid
element foo in file bar, at line x".


Cheers,

         Frans






Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Daniel Veillard 2005-03-29 13:17:46 UTC
Fixed in CVS, I added most of the rules from appendix B of the spec
with respect to the content model of stylesheets elements:

paphio:~/XSLT/libxslt -> xsltproc tst.xsl tst.xsl
compilation error: file tst.xsl line 6 element with-param
element with-param is not allowed within that context
paphio:~/XSLT/libxslt ->

  this was a long term TODO,

Daniel
Comment 2 Frans Englich 2005-03-29 13:51:17 UTC
   
   
Wow, very nice. Productivity & usability got a giant boost. From my experience,   
what people have noticed(on lists like xml-dev, docbook, docbook-apps), is that   
libxslt have accepted those errornous stylesheets, so I think this is a major   
step, and will help people a lot. So make sure it's central in the upcoming 
Changelog :) 
 
 
Cheers, 
   
         Frans  
  
   
Comment 3 Daniel Veillard 2005-09-05 09:41:41 UTC
This should be closed by release of libxslt-1.1.15

  thanks,

Daniel