Hello,
I would like to review the contents of "struct _xmlError" after error.
Following is the contents of my test xml file of which 5th line has wrong closing tag. (using xmlSAXUserParseFile() to process the xml file.)
<hello> <hi>test1</hi> </hello> <hello> <hi>test2<hi> </hello>
Inside the callback function to process error message, I'm calling xmlGetLastError() such as struct _xmlError *xmlErrPtr = NULL; xmlErrPtr = xmlGetLastError(); and the following is the contents of "struct _xmlError"
- xmlErrPtr 0x00677340 domain 1 code 5 + message 0x00cb9aa0 "Extra content at the end of the document" level 3 + file 0x00cb9b08 "file:///C%3A/Temp/test.xml" line 4 + str1 0x00000000 "" + str2 0x00000000 "" + str3 0x00000000 "" int1 0 int2 1 ctxt 0x00cb2928 node 0x00000000
The number in "line" field (4) does not match with the actual wrong line (5) in the test xml file.
In addition, I have XML memory stream (using xmlSAXUserParseMemory() to process) and observed the similar mismatched line number.
char *xmlStream = " \ <axsone version=\"1.0\">\n\ <entries>\n\ <entry>\n\ <library>&TMP<library>\n\ …
- xmlErrPtr 0x00677340 domain 1 code 76 + message 0x00cb9038 "Opening and ending tag mismatch: library line 4 and entry" level 3 + file 0x00000000 "" line 7 + str1 0x00cb90c0 "library" + str2 0x00cb2698 "entry" + str3 0x00000000 "" int1 4 int2 17 ctxt 0x00cb2928 node 0x00000000
The number in "line" field (7) does not match with the actual wrong line (4) in the xmlStream (the "message" field contains the correct line number).
Would you please review what causes this problem?
Best regards, Shigemi Murakami
|