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 132597 - xinclude xinclude, 2nd-level entites are not expanded
xinclude xinclude, 2nd-level entites are not expanded
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-01-26 19:32 UTC by Oleg Paraschenko
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Oleg Paraschenko 2004-01-26 19:32:56 UTC
Code is from CVS, 26 January 2004

Having documents:

----- <document.xml>
<doc>
 <title>Main Document</title>
 <xi:include href="included.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</doc>
----- </document.xml>

----- <included.xml>
<!DOCTYPE doc [
<!ENTITY INC "Included">
]>
<doc>
 <title>&INC; Document</title>
 <xi:include href="subincluded.xml"
xmlns:xi="http://www.w3.org/2003/XInclude"/>
</doc>
----- </included.xml>

----- <subincluded.xml>
<!DOCTYPE doc [
<!ENTITY SUB "Sub">
]>
<doc>
 <title>&SUB; Included Document</title>
</doc>
----- </subincluded.xml>

Processing XInclude with entity expansion (btw, as I remember but not sure,
entities in xincluded infosets must be expanded by specification):

----- <screen>
$ ~/p/libxml/bin/xmllint --xinclude --noent  document.xml
<?xml version="1.0"?>
<!DOCTYPE doc [
<!ENTITY INC "Included">
]>
<doc>
 <title>Main Document</title>
 <doc>
 <title>Included Document</title>
 <doc>
 <title>&SUB; Included Document</title>
</doc>
</doc>
</doc>
----- </screen>

Problem is: entity "SUB" is not expanded (but "INC" is expanded).
Comment 1 William M. Brack 2004-02-05 23:51:57 UTC
This problem is already set as a "TODO" item (see xinclude.c:2156).  
I am therefore changing the severity to "enhancement" (meaning that 
I'll treat the priority as lower than fixing errors / crashes), but 
I'll try to add the necessary code before the next general release.
Comment 2 Oleg Paraschenko 2004-02-07 13:05:42 UTC
Thank you for commenting the issue, but I'd like to say that it is
indeed not an enhancement, but a critical functionality. Let me explain.

There is a CMS system for documentation. It is component-based. Final
documents are assembled from reusable fragments. Documents have
cross-references. In order to have unique IDs across the whole texts,
each text component starts with definition of the entity "BASEID", and
all ID values in the component start with "&BASEID;". If entities
expansion during xinclude not works, the system not works.
Comment 3 William M. Brack 2004-03-07 11:06:51 UTC
I apologize for the rather long time it took to get this one fixed. 
Please try the corrected source in CVS (xinclude.c)

bill@billsuper bug132597 $ xmllint --xinclude --noent document.xml
<?xml version="1.0"?>
<!DOCTYPE doc [
<!ENTITY INC "Included">
]>
<doc>
 <title>Main Document</title>
 <doc>
 <title>Included Document</title>
 <doc>
 <title>Sub Included Document</title>
</doc>
</doc>
</doc>
 
Comment 4 Daniel Veillard 2004-03-25 11:30:45 UTC
This should be closed by release of libxml2-2.6.8,
                                                                                
  thanks,
                                                                                
Daniel