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

Ariel Nunez ingenieroariel at gmail.com
Tue Apr 14 05:55:09 PDT 2020


Hello Andreas,

I also have no idea if that is the right approach :) but I think the next
step with your patch is to both run the test suite and add a few new cases
with single examples and the combined one if at all possible in the form of
a pull request.

I recently got started with the test suite, so if you need help setting
that up just shoot me an email.

Best,
Ariel

On Tue, 14 Apr 2020 at 2:28 AM Andreas Zapke <andreas.zapke at geomap.immo>
wrote:

> 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
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapproxy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20200414/81c3e2bd/attachment.html>


More information about the MapProxy mailing list