Please correct my terminology here if it's off:
The 5 character substitutions for XML are:
- & ( & )
- < ( < )
- > ( > )
- " ( " )
- ' ( ' )
Do all of these substitutions need to happen in a element text? Or only attribute text? (terminology correction?)
e.g. is this valid XML?
<myelement>x && y</myelement>
<myelement>And I quote, "no"</myelement>
>
and <
seem obvious to replace in this context, but I'm not clear if the replacement rules are global for the entire XML document, or if they apply differently to different parts of the document (example, cdata sections apply different rules).
Assumption: this is invalid XML:
<myelement field="no & allowed here"/>
<myelement field="no <> allowed here"/>
Quotes are obvious delimiters of attributes, and <> are obvious delimiters of element text.