XML parse with XMLSchema doesn't give an error's position
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
New
|
Undecided
|
Unassigned |
Bug Description
Python : sys.version_
lxml.etree : (3, 6, 0, 0)
libxml used : (2, 9, 0)
libxml compiled : (2, 9, 0)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)
Try this code with valid 1.xsd and invalid 1.xml:
from lxml.etree import XMLParser, XMLSchema, parse, XMLSyntaxError
parser = XMLParser(
try:
xml = parse(open('1.xml', mode='rb'), parser)
except XMLSyntaxError as e:
for error in parser.error_log:
print error.message, error.line, error.column
error.line and error.column are always 0.
Here is the link to stackoverflow: http://
Dear all,
we encountered the same problem using the following versions:
Python==3.8.4
lxml==4.5.2
as well as on
Python==3.8.0
lxml==4.4.2
Is there any update/feedback concerning this bug?
Thanks for investigating!