GNOME Bugzilla – Bug 738070
xmlTextReaderPreservePattern pattern error
Last modified: 2021-07-05 13:25:29 UTC
Created attachment 287937 [details] bookstore xml file xmlTextReaderPreservePattern does not compile simple xpath expressions and return with code -1. Reproduce steps: 1) compile reader3.c (http://xmlsoft.org/examples/index.html#reader3.c) 2) run with xpath expressions: reader3 bookstore.xml /bookstore/* (WORK) reader3 bookstore.xml /bookstore/book[1] (NOT WORK) reader3 bookstore.xml /bookstore/book[1]/title (NOT WORK)
* @pattern: an XPath subset pattern This is a libxml2 pattern, the patterns are subset of XPath and defined in XMLSchemas 1 http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#coss-identity-constraint [1] Selector ::= Path ( '|' Path )* [2] Path ::= ('.//')? Step ( '/' Step )* [3] Step ::= '.' | NameTest [4] NameTest ::= QName | '*' | NCName ':' '*' this allows streaming but doesn't allow selection based on index. Maybe the patterns could be expanded for that purpose but noone is working on an enhancement there. Certainly not 'critical' from a severity POV Daniel
Perhaps libxml2 documentations could be more clear about, because the W3C recommendations do not speak of "subset pattern" (too much generic). Hope in an enhancement.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.