GNOME Bugzilla – Bug 307946
Attribute default from DTD is lost during XInclude
Last modified: 2021-07-05 11:00:03 UTC
Please describe the problem: When another xml file is included using XInclude, its attributes no longer have a default value from any DTD (neither one included in the parent, nor the child xml) Steps to reproduce: 1. Create the following files ==================== included.xml === <?xml version="1.0"?> <!DOCTYPE mynode [ <!ELEMENT mynode EMPTY> <!ATTLIST mynode test CDATA "wombat"> ]> <mynode/> ==================== test.xml === <?xml version="1.0"?> <!DOCTYPE tools [ <!ELEMENT mynodes (mynode*)> <!ATTLIST mynodes xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude" xml:base CDATA #IMPLIED> <!ELEMENT mynode EMPTY> <!ATTLIST mynode test CDATA "wombat"> ]> <?xml-stylesheet type="text/xsl" href="test.xslt"?> <mynodes xmlns:xi="http://www.w3.org/2001/XInclude" xml:base="./"> <mynode/> <xi:include href="included.xml"/> </mynodes> ==================== test.xslt === <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="//mynode"> attrib=<xsl:value-of select="@test"/> </xsl:template> </xsl:stylesheet> ============================== 2. Run "xsltproc --xinclude test.xml" Actual results: The following output is observed: <?xml version="1.0"?> attrib=wombat attrib= Expected results: I would expect identical behaviour to "xmllint --xinclude test.xml | xsltproc -" Which produces the following output: <?xml version="1.0"?> attrib=wombat attrib=wombat Does this happen every time? Yes Other information: Apologies for not listing a version. I'm using Cygwin's latest. "xsltproc -- version" dumps the following: Using libxml 20616, libxslt 10112-CVS964 and libexslt 810-CVS964 xsltproc was compiled against libxml 20615, libxslt 10112 and libexslt 810 libxslt 10112 was compiled against libxml 20616 libexslt 810 was compiled against libxml 20616
Created attachment 47872 [details] Copy of the code described in original defect file
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/libxslt/-/issues/ Thank you for your understanding and your help.