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 487161 - xmlXPathCompOpEval: function ends-with not found
xmlXPathCompOpEval: function ends-with not found
Status: RESOLVED NOTABUG
Product: libxslt
Classification: Platform
Component: general
1.1.15
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-16 14:13 UTC by sds
Modified: 2019-01-30 12:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
ends-with() implementation+test case (2.79 KB, patch)
2011-06-27 01:36 UTC, Andriy Gerasika
none Details | Review

Description sds 2007-10-16 14:13:21 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
Comment 1 sds 2007-10-16 14:17:52 UTC
fn:matches is not supported either:
xmlXPathCompOpEval: function matches not found
XPath error : Unregistered function
xmlXPathCompiledEval: 1 object left on the stack
Comment 2 Daniel Veillard 2007-10-16 15:34:16 UTC
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
Comment 3 sds 2007-10-16 15:36:37 UTC
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.
Comment 4 Daniel Veillard 2007-10-16 15:43:43 UTC
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
Comment 5 Andriy Gerasika 2011-06-27 01:36:14 UTC
Created attachment 190720 [details] [review]
ends-with() implementation+test case
Comment 6 Andriy Gerasika 2011-06-27 01:47:44 UTC
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...