[xml] Bug/Patch in xinclude when using empty href

Hello All,

    I've been working with libxml2 and xsltproc to process docbook files. The editor that we use creates 
xinclude tags that use empty href tags when referring to the same file. The problem I am encountering is that 
when using xmllint, or the library in general, in this scenario it warns about a recursion. I've attached a 
sample xml file for demonstration. Running 'xmllint --xinclude a.xml' will produce the following error:

a.xml:3: element include: XInclude error : detected a recursion in a.xml

    I was able to determine that the URI was being correctly calculated but that the code was not setting the 
local flag when the href was empty while it was doing so for a missing href or an href starting with a # 
character. I added an additional statement in xinclude.c to check for an empty href and set local to a true 
value and it corrected the problem. I have attached a diff file showing the change for convenience.

    I used the latest version, 2.6.31, for all my testing and changes. I also checked the xinclude spec to 
make sure this was indeed the intended behavior. Your consideration on this issue and submission is greatly 

Chris Ryan

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Attachment: a.xml
Description: Text Data

Attachment: xinclude_c.diff
Description: Binary data

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