Menu

Parsing bug

2007-02-14
2013-05-20
  • Tim Sylvester

    Tim Sylvester - 2007-02-14

    I found numerous postings here about parsing bugs, but this seems to be a new one.  I have updated to the latest version of the code (2.5.2) but with no effect.

    I Narrowed the test case to the smallest possible input that demonstrates the problem.  The following code added to xmltest.cpp will show that the parser incorrectly succeeds without finding the end tag for an open element.  This results in a document with a single "x" element, but should fail.  Note that removing the whitespace following the open tag causes the parse to fail as expected.

        {
            TiXmlDocument xml;
            xml.Parse("<x>");
            XmlTest("Missing end tag at end of input", xml.Error(), true);
            xml.Parse("<x> ");
            XmlTest("Missing end tag with trailing whitespace", xml.Error(), true);
        }

    Output:
    [pass] Missing end tag at end of input [1][1]
    [fail] Missing end tag with trailing whitespace [0][1]

     
    • Lee Thomason

      Lee Thomason - 2007-02-19

      THat's a good bug. I'm moving it to the "bugs" section.

      lee

       

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.