[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Laz2_DOM' (#lazutils)

StrToXMLValue

Converts a string to it representation as XML character data.

Declaration

Source position: laz2_dom.pas line 852

function StrToXMLValue(

  const s: string

):string;

Arguments

s

  

Values to convert to XML character data.

Function result

XML character data for the specified value.

Description

StrToXMLValue is a String function used to convert the value in s to its representation as valid XML character data. The XML specification has five "predefined entities" that represent special characters. StrToXMLValue ensures that any of these characters in s are converted to their representation as a Character Entity, 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)
&lt; < U+003C (Decimal 60) Less-than
&gt; > U+003E (Decimal 62) Greater-than

StrToXMLValue 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 XMLValueToStr to convert XML character data to its representation as a String data type.

See also

XMLValueToStr

  

Converts XML character data to its representation as a string value.


Version 3.2 Generated 2024-02-25 Home