No such thing as a small change | |
PerlMonks |
Re^5: Converting HTML special entities to XMLby Aristotle (Chancellor) |
on Sep 02, 2004 at 17:24 UTC ( [id://388004]=note: print w/replies, xml ) | Need Help?? |
All that is why I'm giving the recommendation that I'm giving. :-) You can work with escaped characters avoid going through Unicode, if you wish; but it is hard to get that really right and most people don't. That's why I assert that you should not work with the HTML directly and should not work with the XML directly. It's safest to think of HTML and XML not as a data format, but as an opaque serialization of a data structure. You ask one deserializer for the data structure, and get something unambiguous (ie, Unicode) that you can work to your heart's content with; then you give the still unambiguous result to another serializer that produces conforming output for you. As I said, you can do it differently. Just as you can avoid using strict. It's jut much easier to not shoot yourself in the foot if you stick to that practice. Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|