GNOME Bugzilla – Bug 160402
Compiles invalid XSLT; with-param in template
Last modified: 2009-08-15 18:40:50 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:
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
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
This should be closed by release of libxslt-1.1.15 thanks, Daniel