After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 307946 - Attribute default from DTD is lost during XInclude
Attribute default from DTD is lost during XInclude
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-16 17:04 UTC by Neil Rickards
Modified: 2021-07-05 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Copy of the code described in original defect file (1.05 KB, application/zip)
2005-06-16 17:06 UTC, Neil Rickards
Details

Description Neil Rickards 2005-06-16 17:04:55 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
Comment 1 Neil Rickards 2005-06-16 17:06:41 UTC
Created attachment 47872 [details]
Copy of the code described in original defect file
Comment 2 GNOME Infrastructure Team 2021-07-05 11:00:03 UTC
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.