Original article address:Processing of special characters in XML files
Author:Spiritual journey
processing special characters in XML files in XML, all valid characters between the start and end tags are faithfully passed to the XML processing Program . To avoid confusion between character data and some special symbols used in tags, XML also provides some useful entity references. Object references are replaced by object references when these special symbols are needed in character data. These special XML Entity references include: & gt; <; & amp; "& quot; '& apos; in this way, if we need to show text in the "example" Mark " Zhang San " correct syntax yes: example> & lt; Name & gt; Zhang San & lt;/Name & gt; easy to understand, the entity reference of the character "<" is essential. For ">", entity reference is also set up to avoid confusion with Mark, the object reference of the character "&" prevents it from being confused with the "&" used in the header in the object reference. So when do we need to use entity references with the remaining two characters? In the tag, you can set attributes for the tag, and XML requires that the attribute values be included in. Therefore, when the character "appears in the attribute value, it must be replaced by an entity reference. See the following example: correct syntax: |