[xslt] An Invalid xpath expression xsl:template/@match node is ignored



Dear libxslt maintainers,
I discover that performing a transformation with a invalid xpath expression in a template match attribute doesn't prevent the transformation to perform and lead to compromise the transformation logic. Instead, I would expect to have a proper failure like `could not compile match expression`

I attached a stylesheet and xml sample to reproduce the issue.

result of transformation:

$ xsltproc xpath-typo.xsl document.xml
error: file xpath-typo.xsl line 10 element template
xsltCompilePattern : NULL pattern
<?xml version="1.0"?>
<result><bug/><bug/></result>
$ echo $?
0


version I'm currently using:

$ xsltproc --version
Using libxml 20708, libxslt 10126 and libexslt 815
xsltproc was compiled against libxml 20708, libxslt 10126 and libexslt 815
libxslt 10126 was compiled against libxml 20708
libexslt 815 was compiled against libxml 20708


Is it a bug ? Should I open a ticket in bug tracker ?

Thanks,

Nicolas
--
Nicolas Delaby | IT Developer | IT Department

Delivery Hero Holding GmbH
Mohrenstraße 60, 10117 Berlin
Office:  +49 30 / 22 01 36 26
Fax:     +49 30 / 22 01 36 28



Geschäftsführer / Managing Directors: Niklas Östberg, Fabian Siegel, Markus Fuhrmann | Internet www.deliveryhero.com | Sitz / registered office Berlin | Amtsgericht / District Court Charlottenburg, Handelsregister / Commercial Register HRB 135090 B
<?xml version="1.0"?>
<node>
    <sub_node1/>
    <sub_node2/>
</node>

Attachment: xpath-typo.xsl
Description: application/xslt



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]