[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: CDATA vs. Escaped characters
----- Original Message ----- From: "Mike Brown" <mike@s...> To: <xml-dev@l...> Cc: <NBEYER@c...> Sent: Wednesday, March 20, 2002 7:58 PM Subject: Re: CDATA vs. Escaped characters > 4. Simple byte counts might be an issue. Using a CDATA section can cut down > the space required to store or transmit those portions of a document that > would otherwise be riddled with numerous escaped characters. On the other > hand, many small, unnecessary CDATA sections can add unnecessary bulk to the > size of the document. > > - Mike There is also a good ol' technology that would work as an alternative here if the content would be riddled with a large percentage of escaped characters: BASE64 encoding. Yes, the content would inflate by 33% (4 bytes to store 3 characters). No, your parser wouldn't decode for you automatically (unless you wrote the parser). However, this can be considerably less (byte counts) than inflation from escaped characters. Also, processing might be a bit easier here, since only one DOM node or SAX event would occur for the encoded content, and the block can be quickly decoded. Of course, it becomes necessary to denote in the XML whether the content is or is not encoded, or to have it understood that the content is always to be encoded. As with any handling of character data in XML, there are trade-offs... My suggestion is to add <![BASE64[ ]]> to XML. :) --- Seairth Jacobs seairth@s...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|