Creating Text
In XML, the value of an element is the text contained between the start and end tags. Text can be stored in either of two ways in an XML document. The first is to store the text in a Text Node. This requires the actual text to obey the rules of XML and not have inappropriate characters in the text. For example, the text cannot contain less than (<) or greater than (>) characters. Otherwise, the XML document would not be well-formed and, therefore, would not load. The second way to store text is to place the text in a CDATA section in the XML document. CDATA sections safely support storing any free-formed text in an XML document.
The following Console application project example demonstrates each of these ways of storing text:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access