encode_xml
NAME
encode_xml(): Encode a given text for XML.TYPE
FunctionDESCRIPTION
Return the given text valid for XML, with special characters properly encoded.
SYNOPSIS
encode_xml(txt TEXT CHARSET utf8) RETURNS TEXT CHARSET utf8
Input:
- txt: an arbitrary text, to be encoded
EXAMPLES
Encode a normal text (no change expetced):
mysql> SELECT encode_xml('The quick brown fox') AS encoded;
+---------------------+
| encoded |
+---------------------+
| The quick brown fox |
+---------------------+
Encode a text with special characters:
mysql> SELECT encode_xml('3 > "2" & 4 < 5') AS encoded;
+-------------------------------------+
| encoded |
+-------------------------------------+
| 3 > "2" & 4 < 5 |
+-------------------------------------+