[MapProxy] GetFeatureInfo fails for infoformat html with AttributeError: 'lxml.etree._XSLTResultTree' object has no attribute 'body'

Andreas Zapke andreas.zapke at geomap.immo
Tue Apr 14 00:05:17 PDT 2020


Hi all,

I have 2 wms sources for getfeatureinfo requests. Both uses xlst-transformation to output html. This works well for each of them if the other one is disabled, but fails for both with:

File "/usr/lib/python3.7/site-packages/mapproxy/featureinfo.py", line 125, in combine
body = tree.body.getchildren()
AttributeError: 'lxml.etree._XSLTResultTree' object has no attribute 'body'

I use: python 3.7, lxml 4.3.4 und MapProxy 1.12.0

It seems that the lxml ElementTree has no body Element here and a additional getroot() is required.
With the following changes in mapproxy/featureinfo.py the concatanation works, but maybe its not the best way?

125c125
<                 body = tree.body.getchildren()
---
>                 body = tree.getroot().body.getchildren()
127,128c127,128
<                 body = tree.getchildren()
<             result_tree.body.extend(body)
---
>                 body = tree.getroot().getchildren()
>             result_tree.getroot().body.extend(body)


Best regards
Andreas


More information about the MapProxy mailing list