Insert an error message block when parsing was stopped after an error

The <parsererror> element was not being added to the parsed document in
certain cases involving attribute parsing. For example, if an undeclared
namespace prefix was used in the document, then parsing would stop, but
a <parsererror> element would not be inserted into the document to
indicate that a parsing error occurred.

When XMLDocumentParser::StopParsing() is called to stop parsing, call
InsertErrorMessageBlock() to insert the <parsererror> element if an
error occurred.

Based on by

Bug: 295809, 898775
Change-Id: Ic67a3ab885fae4b01ca92f6d927b3f523f7423ed
Commit-Queue: Fredrik Söderquist <>
Reviewed-by: Daniel Cheng <>
Cr-Commit-Position: refs/heads/master@{#602674}
2 files changed