Still blocked: the XML parser of the JDK still corrupts some content, which is what XCOMMONS-1373 was about. FormatMojoTest#formatSpecialContentFailingWithXercesFromJDK8 fails without Xerces, and it's reproduced with the JDK parser alone (plain SAX and DOM, no dom4j involved) on Java 21.0.13 and 25.0.5: parsing the test resource XWikiSyntaxLinks.it.xml returns a <content> text in which part of the line containing ]]>>Space1.Page1 is duplicated (the line "Link ad un'immagine con parametri" appears 3 times instead of 2). Xerces 2.12.2 parses the same file correctly. This affects any XML parsed by XWiki (XAR import, filter streams, etc.), not only the XAR format mojo. No matching open OpenJDK bug found so far (the closest are the old buffer border issues JDK-8034087, JDK-8059327, JDK-8061550).
Other findings:
Performance: without Xerces there is no DTD grammar caching anymore, so each XHTML document with a DOCTYPE (XHTML parser: HTML macro, WYSIWYG conversions, etc.) reparses the XHTML DTD. Measured on a small XHTML document: Xerces with grammar cache ~0.92ms, Xerces without cache ~1.44ms, JDK parser ~1.5ms (~0.015ms when the external DTD is not loaded), so about +0.5ms per XHTML document whatever its size. Considered acceptable.
XML bomb and XXE protections still work with the JDK parser (only the error message and the serialization quotes change in XMLUtilsTest).
DefaultXMLReaderFactory must enable namespace awareness explicitly on the JAXP factory to keep the SAX2 defaults Xerces was using.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.