Re: [xml] xmlNodeDump looses data



2008/2/15, Petr Pajas <pajas ufal mff cuni cz>:
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.

I can reproduce with libxml2 2.6.31 on FreeBSD.

Aron


 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

_______________________________________________
 xml mailing list, project page  http://xmlsoft.org/
 xml gnome org
 http://mail.gnome.org/mailman/listinfo/xml






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