I am generating XML dynamically. There may be arbitrary data which is entered by users. Which characters do I have to encode in order to show them properly in the XML file?
I am using PHP.
htmlspecialchars($string, ENT_QUOTES);
< as < for example, and a web browser renders < as < w ithout it having the meaning it does in XML
<>'"&are the 'Big 5'.htmlspecialchars()will do this for you automatically.''s. Otherwise it just encode's<>"&