[XML-SIG] Content is split into two

Stefan Behnel stefan_ml at behnel.de
Thu Mar 27 09:23:54 CET 2008


Hi,

Timothy Wu wrote:
> "You also shouldn't assume that all the characters are passed in a single
> function call."
> 
> Wow, totally unexpected. Wonder why it's designed as it is? This is
> especially weird to me since the string size isn't big (small buffer) and

For you maybe, but nothing keeps an XML document from having text entries of a
couple of megabytes, possibly separated by entity references. Aggregating all
that in memory could be quite expensive, so it's a good design choice not to
require that in the parser.


> this add a bit of complexity to the text processing.

Not that much. The usual pattern is: append text content to a list and join it
when you see something that's not text. That works very well unless your
strings are really long.

Stefan



More information about the XML-SIG mailing list