| Bug #25703 | XML: ExtractValue() user-specified multiple match delimiter | ||
|---|---|---|---|
| Submitted: | 18 Jan 2007 19:14 | Modified: | 1 Apr 2009 11:27 |
| Reporter: | Travis Haagen | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: XML functions | Severity: | S4 (Feature request) |
| Version: | 5.1, 6.0.9 | OS: | Windows (Win32) |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
| Tags: | DELIMITER, ExtractValue, Frq: XML | ||
[18 Jan 2007 19:27]
Travis Haagen
As an example, the following XPath expression returns three results, each seperated by a space, but each also contain a space:
mysql> SELECT ExtractValue(
-> "<a><b>the first</b><b>the second</b></a><a><b>the third</b></a>",
-> "//b") AS RESULT;
+--------------------------------+
| RESULT |
+--------------------------------+
| the first the second the third |
+--------------------------------+
1 row in set (0.00 sec)
[1 Apr 2009 11:27]
Valeriy Kravchuk
Thank you for the feature request.
[21 May 2010 16:13]
Shaun Martinec
Any chance this feature will be in an upcoming 5.1 release? How can I make this change myself?
[14 Mar 2017 15:19]
Jon Miller
The current behavior is shockingly bad. Please at least change the delimiter to something like tab. It is unusable the way it it now.
[4 Apr 2022 10:39]
John Doe
15 years passed and still no solution to this absolutely stupid problem. Another one proof that mysql developers do not give a shit about the quality of their product.

Description: For ExtractValue(), the documentation states that: "If multiple matches are found, then the content of the first child text node of each matching element is returned (in the order matched) as a single, space-delimited string." Using a space as a delimiter doesn't work very well when the results each contain numerous spaces. I propose an overloaded version of ExtractValue() that allows one to optionally specify the delimiter used when multiple results are returned. It could be of the form: ExtractValue(xml_frag, xpath_expr, delimiter) The escape characters listed in section 9.1.1 of the MySQL manual should ideally be supported as valid delimiter values. How to repeat: N/A