OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] CDATA vs. Escaped characters

[ Lists Home | Date Index | Thread Index ]

> From: Seairth Jacobs [mailto:seairth@seairth.com]


> 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.


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS