iterating over DTD file including external entities

Bug #2019256 reported by Adam Byer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
New
Undecided
Unassigned

Bug Description

Hi. New user here. Apologies if this is not the right place. I'm loading a DTD and iterating over the elements like so...

```
from lxml import etree

with open(dtd_file) as f:
    dtd_content = f.read()

dtd = etree.DTD(StringIO(dtd_content))

for el in dtd.iterelements():
...

The DTD file (dtd_file) has a reference to an external entity like this...
```
<!ENTITY % emp SYSTEM "other_file.dtd">
```

It doesn't seem that `iterelements` includes the elements from the external entity (other_file.dtd). Is it possible to have those included?

Thank you.

Python : sys.version_info(major=3, minor=9, micro=10, releaselevel='final', serial=0)
lxml.etree : (4, 9, 2, 0)
libxml used : (2, 9, 13)
libxml compiled : (2, 9, 13)
libxslt used : (1, 1, 35)
libxslt compiled : (1, 1, 35)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.