[xml] xinclude and entities with same name/different content



Hello,

I'm trying to use xinclude to include several documents that have
internal general entities with same name but different content.
This seemed to work with libxml 2.5.1 but after upgrading to 2.5.5
it complains: "mismatch in redefinition of entity title" and does
not include the documents.

Is what I'm trying to do allowed ?
If so, what is the correct way of doing this (other than having unique
entity names in each document) ?
Did it work earlier because of a bug that got fixed somewhere between
2.5.1 and 2.5.5 ?

example of what I'm trying to do:
=============== chapter1.xml ===============
<!DOCTYPE chapter [
<!ENTITY title "chapter 1 title">
]>
<chapter>
        <title>&title;</title>
</chapter>
=============== chapter2.xml ===============
<!DOCTYPE chapter [
<!ENTITY title "chapter 2 title">
]>
<chapter>
        <title>&title;</title>
</chapter>
=============== book.xml ===============
<book xmlns:xi="http://www.w3.org/2001/XInclude";>
<xi:include href="chapter1.xml" />
<xi:include href="chapter2.xml" />
</book>
==============================

output with 2.5.1:

pawel linux:~> xmllint --version
xmllint: using libxml version 20501
compiled with: FTP HTTP HTML C14N Catalog DocBook XPath XPointer XInclude Iconv Unicode Regexps Automata
pawel linux:~> xmllint --xinclude --noent book.xml
<?xml version="1.0"?>
<book xmlns:xi="http://www.w3.org/2001/XInclude";>
<chapter>
        <title>chapter 1 title</title>
</chapter>
<chapter>
        <title>chapter 2 title</title>
</chapter>
</book>


output with 2.5.5:

pawel linux2:~> xmllint --version
xmllint: using libxml version 20505
compiled with: FTP HTTP HTML C14N Catalog DocBook XPath XPointer XInclude Iconv Unicode Regexps Automata Schemas
pawel linux2:~> xmllint --xinclude --noent book.xml
XInclude: mismatch in redefinition of entity title
<?xml version="1.0"?>
<!DOCTYPE book [
<!ENTITY title "chapter 1 title">
]>
<book xmlns:xi="http://www.w3.org/2001/XInclude";>
<xi:include href="chapter1.xml"/>
<xi:include href="chapter2.xml"/>
</book>


thanks,

Pawel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]