Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37568 > unrolled thread

XML validation / exception.

Started byAndrew Robinson <andrew3@r3dsolutions.com>
First post2013-01-24 03:28 +0000
Last post2013-01-24 03:28 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  XML validation / exception. Andrew Robinson <andrew3@r3dsolutions.com> - 2013-01-24 03:28 +0000

#37568 — XML validation / exception.

FromAndrew Robinson <andrew3@r3dsolutions.com>
Date2013-01-24 03:28 +0000
SubjectXML validation / exception.
Message-ID<mailman.967.1359027027.2939.python-list@python.org>
A quick question:

On xml.etree,
When I scan in a handwritten XML file, and there are mismatched tags -- 
it will throw an exception.
and the exception will contain a line number of the closing tag which 
does not have a mate of the same kind.

Is there a way to get the line number of the earlier tag which caused 
the XML parser to know the closing tag was mismatched, so I can narrow 
down the location of the mismatches for a manual repair? (I don't want 
auto-repair like beautiful soup. but google is worthless for finding a 
solution...)

And secondly, for times where I want to throw a software/content 
specific error on valid XML files;
I don't see which attribute of an element, or method, allows me to find 
out the line number and column number that an element I am examining is 
found at.

? How do I get it ?

Cheers, --Andrew.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web