GNOME Bugzilla – Bug 583439
bogus line numbers in push mode
Last modified: 2009-08-23 13:46:32 UTC
Bogus line numbers are reported in push mode: $ cat test.xml <root> <foo></bar> </root> $ xmllint test.xml test.xml:2: parser error : Opening and ending tag mismatch: foo line 2 and bar <foo></bar> ^ $ xmllint --push test.xml test.xml:2: parser error : Opening and ending tag mismatch: foo line 0 and bar <foo></bar> ^
Okay, I can fix this but only if there is a tree being built by the parser, since in push mode we don't have a stack to hold the start line of each parsed element, I can get that line number from the node itself: paphio:~/XML -> xmllint --push test.xml test.xml:7: parser error : Opening and ending tag mismatch: foo line 2 and bar </bar> ^ paphio:~/XML -> cat test.xml <root> <foo> </bar> </root> paphio:~/XML ->