diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 1b54017..140df86 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -2301,6 +2301,7 @@ void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... { TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT ); _errorID = error; + _errorLineNum = lineNum; _errorStr.Reset(); if (format) { diff --git a/xmltest.cpp b/xmltest.cpp index 96cbf64..01b5011 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -499,9 +499,13 @@ int main( int argc, const char ** argv ) int value2 = doc->FirstChildElement()->LastChildElement()->IntAttribute( "attrib", replacementIntValue ); XMLError result = doc->FirstChildElement()->LastChildElement()->QueryIntAttribute( "attrib", &value1 ); XMLTest( "Programmatic DOM", XML_NO_ATTRIBUTE, result ); + doc->PrintError(); XMLTest( "Programmatic DOM", defaultIntValue, value1 ); XMLTest( "Programmatic DOM", replacementIntValue, value2 ); + + exit(0); + doc->Print(); {