Nick Sieger: So if you’re living on the edge using the newly minted ActiveResource fetching XML from remote resources like a champion, you just got benched as soon as you tried to fetch XML that had normalized entities inside.
It continues to surprise me how many of the same people who are attracted to the elegant syntax of the Ruby language exhibit a somewhat cavalier attitude towards producing interoperable markup.
For those who are curious, this bug is REXML ticket #44., and here is the string that the original author of this ticket was trying to insert into his document:
int *intp = &aninteger;
The flip side of this is software that performs extra escaping “just in case”. Many blogging tools do this. Try entering the following into the title of a post:
< and & are problem characters
Now preview your feed using IE7 or FF2 or your favorite news reader, like Bloglines or Google Reader. Even these many years later, the correct way to express that title in RSS 2.0 is still a matter of debate; but if you have an Atom 1.0 feed, each should render this string identically, and if what you see is not what you entered, then your blogging software has a bug in it.
I wonder how you could hope to recast REXML on top of libxml2 in light of this, given that existing users of REXML would already be built based on assumptions in the API like “escape any text that isn’t already escaped”, or how this behaviour can be changed in REXML given that existing applications somewhere are understandably taking advantage of it to “clean up” text to be inserted into HTML.
I doubt if we mean the same here.
Actually I want even entities escapes. So if somebody sends a message
containing “Use & to escape & in XML” it should be serialized in the
XMPP stream as “Use &amp; to escape & in XML”.
Is this the same issue or do you have any pointers how to achieve this?
Same issue. Currently, if text is well formed, REXML doesn’t mess with it.
This is not very useful, in practice; I think your use case is more common,
and I want the default behavior to be to escape all text created with the API
unless told otherwise.
I love sacha’s idea for a personal board of directors. I think it’s a great idea for, well, just about everybody. Speaking of Sacha, what would you do with her? Armed with infectious enthusiasm, charm and smarts, she would be an excellent person to...