1

I am trying to get list of all XML and XSLT files from GeoServer using REST API.

I am using path: my_geoserver/geoserver/rest/services/wfs/transforms

and code:

request_url = server + "/geoserver/rest/services/wfs/transforms.xml"
headers = {'Content-Type': 'text/xml'}
auth = ('user', 'pass')

r = requests.get(
request_url,
headers=headers,
auth=auth)


root = ET.fromstring(r.content)

xml_list = []
xml_path_list = []
for xml in root.findall('transform'):
    xml_name= xml.find('name').text
    xml_path= "my_geoserver/geoserver/rest/services/wfs/transforms/" + xml_name + ".xml"
    xml_list.append(xml_name)
    xml_path_list.append(xml_path)

With that code I get list of XML files

How can I get list of XSLT files?

2
  • My GeoServer refuses to admit that this is a valid endpoint but looking at the docs suggests that you need to set the response type to application/xslt+xml to see the actual XSLT
    – Ian Turton
    Commented Dec 15, 2020 at 17:16
  • @IanTurton Thank you, that is a solution :)
    – ncica
    Commented Dec 15, 2020 at 17:22

1 Answer 1

1

My GeoServer refuses to admit that this is a valid endpoint but looking at the docs suggests that you need to set the response type to application/xslt+xml to see the actual XSLT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.