Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
2.12.2
-
None
-
jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ java -version
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (Temurin)(build 25.332-b09, mixed mode)
jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $
I downloaded Xerces-J-src.2.12.2.tar.gz and Xerces-J-tools.2.12.2.tar.gz and built same, then tested with the example file above.
Attaching examples_log.txt, dated Wednesday Aug 17, 2022 11:35:34 AM, of runs for both files also showing xmllint output successfully resolving the XIncludes.jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ java -version openjdk version "1.8.0_332" OpenJDK Runtime Environment (Temurin)(build 1.8.0_332-b09) OpenJDK 64-Bit Server VM (Temurin)(build 25.332-b09, mixed mode) jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ I downloaded Xerces-J-src.2.12.2.tar.gz and Xerces-J-tools.2.12.2.tar.gz and built same, then tested with the example file above. Attaching examples_log.txt, dated Wednesday Aug 17, 2022 11:35:34 AM, of runs for both files also showing xmllint output successfully resolving the XIncludes.
-
Important
Description
Suppose a3.xml:
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="a-book" version="5.0"> <title>A</title> <chapter xml:id="a-chapter"> <title>a chapter</title> <BurstingPara xml:id="t1000">Warning: Read following paragraph carefully.</BurstingPara> <para>foo</para> <xi:include href="a3.xml" xpointer="t1000"/> <para>foo2</para> <xi:include href="a3.xml" xpointer="t1000"/> <para>foo3</para> </chapter> <xi:include href="a3.xml" xpointer="a-chapter"/> </book>
Xerces 2.12.2 rejects the XML with:
edit: added CLASSPATH recital below to provide context for following session:
jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ date;echo $CLASSPATH Wed Aug 17 12:19:41 PDT 2022 .:build/xercesSamples.jar:build/xercesImpl.jar:build/serializer.jar:build/resolver.jar jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ java dom.Writer -xi a3.xml [Fatal Error] a3.xml:1:1: Recursive include detected. Document 'file:///usr/local/src/xerces_2.12.2/xerces-2_12_2/a3.xml' was already processed. [Fatal Error] a3.xml:11:53: Error attempting to parse XML file (href='a3.xml'). jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ {noformat} The XML XIncludes above are a legal construct, yet Xerces throws an error when the parser should process the XIncludes. This bug mimics the bug encountered in the Gnome XMLParser2 project:[ xmllint handling of recursion|[https://gitlab.gnome.org/GNOME/libxml2/-/issues/348]] Here is another sample file illustrating the failure: {code:java} <book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="b-book" version="5.0"> <title>B</title> <chapter xml:id="b-chapter"> <title>b chapter</title> <para>foo</para> </chapter> <xi:include href="a3.xml" xpointer="a-chapter"/> </book>