[xml] xmlNodeDump looses data



Hi Daniel, All,

one of the users of the Perl bindings reported a strange bug which I 
was able to reduce to the attached very very simple "test.c" 
program and a XML file "test2.xml". 

The program parses the XML file into a tree, and then dumps the root 
element using xmlNodeDump.

In the result, a complete text content of a text node within an 
element <linkage> is missing.

The behavior depends on various factors: 

- the length of the input file (if you add 400 characters before the 
<linkage> element, the output is correct)

- if formatting is turned on at xmlNodeDump, the output is correct
  (this is probably why the bug cannot be reproduced with the 'cat' 
command of xmllint --shell, since the formatting is turned on 
there)

- if the complete document is dumped, it is correct.

- if the (about 50) characters <,> (rendered as entities &lt; &gt;) 
are replaced with e.g. _, the output is correct

- the output (I'm told) is correct with libxml2 <=2.6.27

- the structure of the document seems to be also important

The bug seems to me rather serious since it can have really bad 
consequences for applications that use xmlNodeDump.

Please let me know if you need more information.

-- Petr

Attachment: test.c
Description: Text Data

Attachment: test2.xml
Description: Text Data



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