I’m capturing data from the user and writing it to an xml string like so:
var myXml:XML =
{userEnteredText}
This is fine and dandy until the user gets cute with special characters like “& < >” etc. Illegal characters are also a problem like 0x19.
Is there are method that will sanatize my xml and encode special characters or will I have to roll my own?
simply converting the string to a textnode should do the trick
also, you can stuff all the content into CTADA …
i’m not sure, why 0x19 should be illegal … whitespaces and nullbytes are often dropped … but if it is binary data you want, you should probably use base64 … >here’s a lib<