in reply to parsing reserved chars with xml::simple

XML::Simple will change all the entities for special characters into the characters when it parses text and attribute values.

You can't easily escape the reserved characters in the not-quite XML without a heuristic parser. For example, & is the entity for encoding &. You wouldn't want to turn that into &amp;. Also, < and > are reserved characters with < and > for entities. How would you distinguish between bad characters in text and the real tags?

The only place that knows what is text and what is elements is the source of the XML. You need to fix the source of the XML that is not encoding special characters to entities in text and attribute values.

  • Comment on Re: parsing reserved chars with xml::simple