parse errors in generic entityies are not properly reported
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
New
|
Undecided
|
Unassigned |
Bug Description
Somethings seems to be wrong with the parser when generic entities
are involved:
This program does not throw an error unless there is
also an error in the root document:
*** getloc.py
import sys, os
from lxml import etree
os.environ[
parser = etree.XMLParser
with open(sys.
tree = etree.parse( f, parser )
*** book.dtd
<!ELEMENT book (chapter)* >
<!ELEMENT chapter (#PCDATA|b)* >
<!ELEMENT b (#PCDATA) >
<!ATTLIST chapter nr CDATA #REQUIRED >
*** catalog.xml
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.0//EN"
"file:
<catalog xmlns="
<public publicId=
</catalog>
*** part1.xml
<chapter nr="1">
<x/>
</chapter>
<chapter nr="2">
</chapter>
Running the program with this root document runs errorneously fine
*** book-a.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//TEST//DTD BOOK//EN" "book.dtd" [
<!ENTITY part1 SYSTEM "part1.xml">
]>
<book>
&part1;
<chapter nr="3">
</chapter>
This one drops the error from part1:
*** book-b.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//TEST//DTD BOOK//EN" "book.dtd" [
<!ENTITY part1 SYSTEM "part1.xml">
]>
<book>
&part1;
<chapter nr="3">
<z/>
</chapter>