[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: CDATA vs. Escaped characters
> From: Seairth Jacobs [mailto:seairth@s...] <snip/> > 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. This is not quite true. The number of SAX events that get generated is entirely implementation dependent. You cannot make any reliable assumptions in the general case about this, although prevailing implementations may show certain consistent behavior. If you want your code to work reliably with any SAX-compliant implementation, you must always code with the assumption that you will get multiple calls to the "characters" method. The DOM is different in this regard, I believe, because it works at a higher level of abstraction. You won't get multiple Text nodes if there is no markup within the text. SAX parsers, though, are not required to abide by any such contract.
|
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
|