-------------+-----------------+

Matches
-------

Important: The EXTRACTVALUE() function only returns CDDATA. It does not return
tags that the element might contain or the text that these child elements
contain.

SELECT

EXTRACTVALUE('<cases><case>Person<email>x@example.com</email></case></cases>',
'/cases')
 AS Case;
+--------+
| Case   |
+--------+
| Person |
+--------+

Note, in the above example, while the XPath expression matches to the parent
<case> instance, it does not return the contained <email> tag or its content.

Examples
--------

SELECT
  ExtractValue('<a>ccc<b>ddd</b></a>', '/a')            AS val1,
  ExtractValue('<a>ccc<b>ddd</b></a>', '/a/b')          AS val2,
  ExtractValue('<a>ccc<b>ddd</b></a>', '//b')           AS val3,
  ExtractValue('<a>ccc<b>ddd</b></a>', '/b')            AS val4,
  ExtractValue('<a>ccc<b>ddd</b><b>eee</b></a>', '//b') AS val5;
+------+------+------+------+---------+
| val1 | val2 | val3 | val4 | val5    |
+------+------+------+------+---------+
| ccc  | ddd  | ddd  |      | ddd eee |
+------+------+------+------+---------+

URL: https://mariadb.com/kb/en/extractvalue/https://mariadb.com/kb/en/extractvalue/