12.12 XML Functions This section discusses XML and related functionality in MySQL. It is possible to obtain XML-formatted output from MySQL in the  mysql  and mysqldump  clients by invoking them with the  --xml  option. See Section 4.5.1, “mysql — The MySQL Command-Line Client” , and Section 4.5.4, “mysqldump — A Database Backup Program” . Two functions providing basic XPath 1.0 (XML Path Language, version 1.0) capabilities are available. Some basic information about XPath syntax and usage is provided later in this section; however, an in- depth discussion of these topics is beyond the scope of this manual, and you should refer to the XML Path Language (XPath) 1.0 standard for definitive information. A useful resource for those new to XPath or who desire a refresher in the basics is the Zvon.org XPath Tutorial, which is available in several languages. These functions remain under development. We continue to improve these and other aspects of XML and XPath functionality in MySQL 8.0 and onwards. You may discuss these, ask questions about them, and obtain help from other users with them in the MySQL XML User Forum. XPath expressions used with these functions support user variables and local stored program variables. User variables are weakly checked; variables local to stored programs are strongly checked (see also Bug #26518): • User variables (weak checking).   Variables using the syntax  $@ variable_name  (that is, user variables) are not checked. No warnings or errors are issued by the server if a variable has the wrong type or has previously not been assigned a value. This also means the user is fully responsible for any typographical errors, since no warnings are given if (for example)  $@myvairable  is used where $@myvariable  was intended. Example: mysql>  SET @xml = ’<a><b>X</b><b>Y</b></a>’; Query OK, 0 rows affected (0.00 sec) mysql>  SET @i =1, @j = 2; Query OK, 0 rows affected (0.00 sec) mysql>  SELECT @i, ExtractValue(@xml, ’//b[$@i]’); 1 row in set (0.00 sec) Table 12.16 XML Functions Note Note XML Functions | Warning | 1292 | Truncated incorrect YEAR value: ’1979aaa’ | +---------+------+-------------------------------------------+ Name Description ExtractValue() Extract a value from an XML string using XPath notation UpdateXML() Return replaced XML fragment +------+--------------------------------+ | @i | ExtractValue(@xml, ’//b[$@i]’) | +------+--------------------------------+ | 1 | X | +------+--------------------------------+ 2247