Menu

#169 libxml2 parser not always issues elementendcommand

C/C++ Module
open
TclXML (91)
5
2006-11-29
2006-11-27
Roalt
No

After replacing the pure-tcl tclxml parser by a libxml2 parser (version 3.1), I noticed some errors. My application only uses -elementstartcommand, -elementendcommand and -characterdatacommand to parse a XML file.

The -elementendcommand is not (always) issued after a single XML-tag (with a closing '/' at the end), such as <hello/>

(Note: Version 3.0 does it even worse)

Discussion

  • Steve Ball

    Steve Ball - 2006-11-29
    • assigned_to: nobody --> balls
     
  • Nobody/Anonymous

    Logged In: NO

    I have also seen this problem. In the 3.1 version, it happens only when the empty tag also has attributes. The problem can be traced down to the tcllibxml2.c file. In ReaderParse, the following line:

    empty = xmlTextReaderIsEmptyElement(info->reader);

    should be moved up a few lines to before the parsing of the attributes. Otherwise, the reader state changes after the attributes are read and xmlTextReaderIsEmptyElement always reports false, whether or not the start tag actually is empty.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.