GNOME Bugzilla – Bug 487161
xmlXPathCompOpEval: function ends-with not found
Last modified: 2019-01-30 12:26:11 UTC
Please describe the problem: fn:ends-with is not supported: xmlXPathCompOpEval: function ends-with not found XPath error : Unregistered function xmlXPathCompiledEval: 1 object left on the stack see http://www.w3schools.com/xpath/xpath_functions.asp Steps to reproduce: 1. create a stylesheet using ends-with 2. run xsltproc 3. observe the error Actual results: error Expected results: output Does this happen every time? yes Other information: $ xsltproc -versionUsing libxml 20623, libxslt 10115 and libexslt 812 xsltproc was compiled against libxml 20623, libxslt 10115 and libexslt 812 libxslt 10115 was compiled against libxml 20623 libexslt 812 was compiled against libxml 20623 $ rpm -q libxslt libxslt-1.1.15-1.2.1
fn:matches is not supported either: xmlXPathCompOpEval: function matches not found XPath error : Unregistered function xmlXPathCompiledEval: 1 object left on the stack
I assume it is abour EXSLT regexp functions. They aren't supported because I don't have a portable way to support them on all platforms where xsltproc builds. Patches can be sent and discussed on the mailing-list though Daniel
ends-with is a sister function to a supported function starts-with. I don't see why the former can't be supported while the latter is.
Ohhh, very simple: starts-with() is a function defined by XPath-1.0 http://www.w3.org/TR/xpath#function-starts-with you will easilly discover that ends-with() is not defined in XPath 1.0 ! So using one is correct XPath-1.0 while using the other one must raise an error ! Daniel
Created attachment 190720 [details] [review] ends-with() implementation+test case
ends-with() is an XPath 2.0 function above you can find an implementation plus test-case it is difficult to implement full XPath 2.0 support in libxml2, but it would be very cool if libxml2 will support some functions from XPath 2.0: ends-with() string-join() tokenize() lower-case() upper-case() etc. it would be kinda XPath 1.5...