XMLValueToStr function
Converts XML character data to its representation as a string value.
Declaration
function XMLValueToStr(const s: string): stringArguments
s | XML character data to convert in the method. |
Function result
Plain string representation for the XML character data.
Description
XMLValueToStr is a
String function used to convert the
XML character data in s to its representation as a string data type. The XML
specification has five "predefined entities" that represent special
characters. XMLValueToStr ensures that any of these character entities in s
are converted to their plain string representation, including:
| Character | Entity Name | Unicode Codepoint | Description |
| " | " | U+0022 (Decimal 34) | Double quotation Mark |
| & | & | U+0026 (Decimal 38) | Ampersand |
| ' | ' | U+0027 (Decimal 39) | Apostrophe (Apostrophe-Quote) |
| < | < | U+003C (Decimal 60) | Less-than |
| > | > | U+003E (Decimal 62) | Greater-than |
XMLValueToStr also ensures that any NULL character values (Decimal 0) in s are removed.
No actions are performed in the method when s is an empty string ('').
Use StrToXMLValue to convert a string data type to its representation as XML character data.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
