GNOME Bugzilla – Bug 324081
Entire file is parsed for XIncludes, even when XPointer only asks for part, leading to errors
Last modified: 2021-07-05 13:27:01 UTC
When part of a file is included via XInclude and XPointer, the recursion detection triggers if that file contains an xi:include to a file which is currently being processed, even if that xi:include is not within the section being included. For example, say we have two files, yellow.xml and orange.xml. Both contain a <title> section, containing CDATA, and an <other_colours> section, containing the value of the title of the other. This <other_colours> value is included by using an xinclude with xpointer pointing at the <title> section of the other file. libxml2 will fail to parse either of the files, because they reference one another and this is detected as a loop, even though no loop actually exists. Section 4.2.7 of the XInclude specification says: When recursively processing an xi:include element, it is a fatal error to process another xi:include element with an include location and xpointer attribute value that have already been processed in the inclusion chain. This rule does not apply in the current case, since although the include location is the same, the xpointer attribute value is different.
Created attachment 55990 [details] Demonstration of the problem Demonstration of the problem (using the perl binding)
*** Bug 344240 has been marked as a duplicate of this bug. ***
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.