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]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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]
THat's a good bug. I'm moving it to the "bugs" section.
lee