node-xml icon indicating copy to clipboard operation
node-xml copied to clipboard

parseString() triggers onEndDocument() on every invocation

Open laurie71 opened this issue 14 years ago • 0 comments

The onEndDocument() callback seems to be fired every time the parser reaches the end of available input when working in chunked mode. I would expect it only to be invoked follow a fatal error, if at all, during chunked parsing; there's actually no way for the parser to know if the document has been fully parsed, since there can be trailing comments and/or PIs following the closing tag of the document element. There should probably be a parser.end() API so clients can signal end of input when using chunked parsing.

laurie71 avatar Feb 08 '11 09:02 laurie71