decode_xml

NAME

decode_xml(): Decode XML characters in text.

TYPE

Function

DESCRIPTION

Return a decoded (unescaped) text of a given XML-valid text

SYNOPSIS

decode_xml(txt TEXT CHARSET utf8)
  RETURNS TEXT CHARSET utf8 

Input:

  • txt: a XML text, to be decoded

EXAMPLES

Decode a normal text (no change expetced):

mysql> SELECT decode_xml('The quick brown fox') AS decoded;
+---------------------+
| decoded             |
+---------------------+
| The quick brown fox |
+---------------------+

Encode a text with special characters:

mysql> SELECT decode_xml('3 > "2" & 4 < 5') as decoded;
+-----------------+
| decoded         |
+-----------------+
| 3 > "2" & 4 < 5 |
+-----------------+

ENVIRONMENT

MySQL 5.1 or newer

SEE ALSO

encode_xml()

AUTHOR

Shlomi Noach
 
common_schema documentation