[
Lists Home |
Date Index |
Thread Index
]
> From: Seairth Jacobs [mailto:seairth@seairth.com]
<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.
|