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 139520 - xinclude fallback repeats
xinclude fallback repeats
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.9
Other Linux
: Normal major
: ---
Assigned To: William M. Brack
libxml QA maintainers
: 140000 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-04-08 20:57 UTC by Ryan Nowakowski
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ryan Nowakowski 2004-04-08 20:57:40 UTC
When running 'xmllint --xinclude' on a document with multiple non-nested
xincludes with fallbacks, the fallback gets repeated in the output.

a.xml:

<a>
        <xi:include href="b.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
                <xi:fallback>There is no b.xml ... </xi:fallback>
        </xi:include>
        <xi:include href="c.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
                <xi:fallback>There is no c.xml ... </xi:fallback>
        </xi:include>
 
</a>

xmllint --xinclude a.xml
I/O warning : failed to load external entity "b.xml"
I/O warning : failed to load external entity "c.xml"
I/O warning : failed to load external entity "c.xml"
<?xml version="1.0"?>
<a>
        There is no b.xml ...
        There is no c.xml ... There is no c.xml ...
 
</a>
Comment 1 William M. Brack 2004-04-14 09:49:56 UTC
*** Bug 140000 has been marked as a duplicate of this bug. ***
Comment 2 William M. Brack 2004-04-16 08:13:48 UTC
I made a small enhancement to the fallback processing which (I hope) will fix 
this problem.  I also added your testfile to the regression tests.  Fixed 
source is in CVS (xinclude.c).
Thanks for the report.
Comment 3 Daniel Veillard 2004-04-18 23:57:14 UTC
  This should be closed by release 2.6.9,
                                                                                
   thanks,
                                                                                
Daniel
Comment 4 Ryan Nowakowski 2004-05-11 19:46:29 UTC
This bug is still present in 2.6.9.  Here's my test:

rnowakow@murdock:~/fallback_test$ cat a.xml
<?xml version="1.0" encoding="UTF-8"?>
<a>
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="b.xml">
                <xi:fallback>
                        <tag>b.xml was not found</tag>
                </xi:fallback>
        </xi:include>
 
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="c.xml">
                <xi:fallback>
                        <tag>c.xml was not found</tag>
                </xi:fallback>
        </xi:include>
</a>


rnowakow@murdock:~/fallback_test$ xmllint --xinclude a.xml
I/O warning : failed to load external entity "b.xml"
I/O warning : failed to load external entity "c.xml"
I/O warning : failed to load external entity "c.xml"
<?xml version="1.0" encoding="UTF-8"?>
<a>
 
                        <tag>b.xml was not found</tag>
 
 
 
                        <tag>c.xml was not found</tag>
 
                        <tag>c.xml was not found</tag>
 
</a>
Comment 5 William M. Brack 2004-05-11 23:06:34 UTC
Sorry, but I cannot reproduce this.  As mentioned previously, your test 
program was added to the "regression tests" of the library, and when I compile 
release 2.6.9 the tests pass:

wbrack@billsuper libxml2-2.6.9 $ ./xmllint --version
/home/wbrack/libxml2-2.6.9/.libs/lt-xmllint: using libxml version 20609
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude 
Iconv Unicode Regexps Automata Schemas

wbrack@billsuper libxml2-2.6.9 $ cat test/XInclude/docs/fallback2.xml
<a>
        <xi:include href="b.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
                <xi:fallback>There is no b.xml ... </xi:fallback>
        </xi:include>
        <xi:include href="c.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
                <xi:fallback>There is no c.xml ... </xi:fallback>
        </xi:include>

</a>

wbrack@billsuper libxml2-2.6.9 $ make XIncludetests
## XInclude regression tests
## XInclude xmlReader regression tests

wbrack@billsuper libxml2-2.6.9 $ cat result/XInclude/fallback2.xml
<?xml version="1.0"?>
<a>
        There is no b.xml ...
        There is no c.xml ...

</a>

Can you please re-check your installation, and your library paths, and let me 
know the result?  Thanks.
Bill
Comment 6 Ryan Nowakowski 2004-05-12 04:23:03 UTC
In my comment above, I included a NEW example that breaks the fallback.  It's 
different than the original example.  The new one contains an XML tag inside 
the fallback(which breaks the fallback code again).  The old one didn't.  
Here's the new example again(notice the tag inside the fallback): 
 
rnowakow@murdock:~/fallback_test$ cat a.xml 
<?xml version="1.0" encoding="UTF-8"?> 
<a> 
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="b.xml"> 
                <xi:fallback> 
                        <tag>b.xml was not found</tag> 
                </xi:fallback> 
        </xi:include> 
  
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="c.xml"> 
                <xi:fallback> 
                        <tag>c.xml was not found</tag> 
                </xi:fallback> 
        </xi:include> 
</a> 
 
 
rnowakow@murdock:~/fallback_test$ xmllint --xinclude a.xml 
I/O warning : failed to load external entity "b.xml" 
I/O warning : failed to load external entity "c.xml" 
I/O warning : failed to load external entity "c.xml" 
<?xml version="1.0" encoding="UTF-8"?> 
<a> 
  
                        <tag>b.xml was not found</tag> 
  
  
  
                        <tag>c.xml was not found</tag> 
  
                        <tag>c.xml was not found</tag> 
  
</a> 
 
Comment 7 William M. Brack 2004-05-12 09:37:59 UTC
Ah, yes - sorry about that ... my eyes see only what they want to see :-).  
OK, I have done a little further enhancement of xinclude.c which (I hope) will 
fix the problem (at least it works for me):

bill@billsuper bug139520 $ ../xmltest/xmllint --xinclude --noblanks bug2.xml
I/O warning : failed to load external entity "b.xml"
I/O warning : failed to load external entity "c.xml"
<?xml version="1.0" encoding="UTF-8"?>
<a><tag>b.xml was not found</tag><tag>c.xml was not found</tag></a>

Fixed source is in CVS - thanks for your patience.

Bill
Comment 8 William M. Brack 2004-05-12 09:39:19 UTC
(sorry about all the bugzilla messages - it's my fumble fingers at work)
Comment 9 Daniel Veillard 2004-07-06 08:55:55 UTC
This should be closed in libxml2-2.6.11,
                                                                                
  thanks,
                                                                                
Daniel