[Standards] <[CDATA[ in XMPP
rcb at ceruleanstudios.com
Tue Jul 31 01:49:45 UTC 2007
On Jul 30, 2007, at 6:28 PM, Justin Karneges wrote:
> On Monday 30 July 2007 5:37 pm, Rachel Blackman wrote:
>> If I send '<item> stpeter at jabber.org</item>' to the server in a
>> roster add/remove request, it will almost certainly eat that
>> whitespace at the beginning.
> It most certainly must not do that.
I cannot remember which server it was that I encountered, but one
consumed all 'extraneous' whitespace (even inside of stanzas) to deal
with the common practice of sending whitespace to keepalive a
I do not dispute that the behavior is likely erroneous, but it was in
place in at least one server; I witnessed it when it would eat any
leading spaces in a <body/> element.
>> But now let's say I do '<item><![CDATA[ stpeter at jabber.org]]></item>'
>> -- is that processed as ' stpeter at jabber.org' (with the raw space),
>> thus requiring a CDATA block any time you want to refer to that JID?
>> Or is the burden on the server to convert it to \20stpeter at jabber.org
>> for the sake of compatibility, or what?
> <item> stpeter at jabber.org</item>
> and this:
> <item><![CDATA[ stpeter at jabber.org]]></item>
> have identical meaning. JID escaping does not come into play here
Fine. If we must be pedantic in this discussion rather than actually
addressing the issue, how about using a different example.
What about using CDATA versus JID escaping for a hypothetical JID
which should display to the end-user as 'john&mary at family.org'?
Should that be a JID-escaped string when you send it to the server?
Should it be CDATA-enclosed? It can't be sent raw, either way, due
to the ampersand.
My thought is that if we allow CDATA, it should only be allowed in
message elements, because otherwise you end up with questions like
this. Of course, that's an un-XML-ish limitation of CDATA, so...
Rachel Blackman <rcb at ceruleanstudios.com>
Trillian Messenger - http://www.trillianastra.com/
More information about the Standards