Draft: libs/xml2: Tolerate embedded XML declarations inside elements.

Some applications embed declarations inside XML elements as part of nested sub-documents. Windows MSXML tolerates this pattern, but libxml2 rejects it with XML_ERR_RESERVED_XML_NAME.

When an embedded processing instruction is encountered inside an element (nodeNr > 0), suppress the fatal error and consume all content from the embedded declaration up to the parent element's closing tag, emitting it as a text node via the SAX characters callback. This matches the behavior applications expect: the content after the embedded is treated as opaque text, not parsed as child elements.

Merge request reports

Loading