element.base shows parent file when xinclude is used

Bug #1785224 reported by Andreas Hagmann on 2018-08-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Undecided
Unassigned

Bug Description

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

Using an XML with xi:include and parse it with xinclude() results in wrong 'base' attribute for elements in the included file. The 'base' shows the root document instead of the included ones. The 'sourceline' attribute seems to be correct.

The attached example gives:
sheets /tmp/lxml/root.xml 3
sheet /tmp/lxml/root.xml 1

expected is:
sheets /tmp/lxml/root.xml 3
sheet /tmp/lxml/inc.xml 1

Andreas Hagmann (andreash2018) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments