Bug #18170 XML: ExtractValue(): XPath expression can't use QNames (colon in names)
Submitted: 12 Mar 2006 21:45 Modified: 5 May 2006 19:12
Reporter: Roland Bouman
Status: Closed
Category:Server: XML Severity:S3 (Non-critical)
Version:5.1.7/5.1.8 BK OS:Microsoft Windows (win xp pro/Suse Linux 10)
Assigned to: Alexander Barkov Target Version:

[12 Mar 2006 21:45] Roland Bouman
Description:
The ExtractValue() functions allows one to extract data from an XML fragment using an
XPath expression. The XPath expression should be able to contain fully qualified names,
but this leads to the following error:

ERROR 1105 (HY000): XPATH syntax error: ':<tagname>)'

In other words, the parser sees it as an error to have a colon inside a name. 
This makes it totally impossible to work with namespaces

How to repeat:
mysql> select extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)');
ERROR 1105 (HY000): XPATH syntax error: ':element)'

Suggested fix:
Allow the XPath to contain fully qualified names
[12 Mar 2006 22:15] Roland Bouman
just updated the title
[13 Mar 2006 2:38] Miguel Solorzano
Thank you for the bug report.
[17 Apr 2006 8:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5003
[26 Apr 2006 17:07] Sergey Gluhov
ok to push
[3 May 2006 16:17] Alexander Barkov
Fixed in 5.1.10
[5 May 2006 19:12] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented feature change in 5.1.10 changelog and XML Functions section of 5.1 Manual.
Closed.