xpath: Fix parsing of non-ASCII names Fix a long-standing issue where QNames starting with a non-ASCII character would be rejected. This became more visible after "streaming" XPath evaluation was disabled since the latter handled non-ASCII names correctly. https://gitlab.gnome.org/GNOME/libxml2/-/issues/818 https://gitlab.gnome.org/GNOME/libxml2/-/commit/459146140aa0cb7a47f1c67d5a2a3ddb59524b63 --- /dev/null +++ result/XPath/tests/unicodesimple @@ -0,0 +1,6 @@ + +======================== +Expression: /文書 +Object is a Node Set : +Set contains 1 nodes: +1 ELEMENT #E6#96#87#E6#9B#B8 --- /dev/null +++ test/XPath/docs/unicode @@ -0,0 +1 @@ +<文書>text1 --- /dev/null +++ test/XPath/tests/unicodesimple @@ -0,0 +1 @@ +/文書 --- xpath.c.orig +++ xpath.c @@ -10081,8 +10081,9 @@ xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) { } else if (CUR == '/') { NEXT; SKIP_BLANKS; - if ((CUR != 0 ) && - ((IS_ASCII_LETTER(CUR)) || (CUR == '_') || (CUR == '.') || + if ((CUR != 0) && + ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) || + (CUR == '_') || (CUR == '.') || (CUR == '@') || (CUR == '*'))) xmlXPathCompRelativeLocationPath(ctxt); }