Identify if issue with same name in XML WMS capabilities
✓ Published0🌍 Public
TThomasG77
Last edited Nov 24, 2022
Created on Nov 24, 2022
This example checks WMS GetCapabilities XML files for duplicate layer names, which can cause issues in clients. It parses the XML using either `lxml` or Python’s built-in `xml.etree.ElementTree` via `etree.parse`, then uses XPath expressions to find all `<Layer>` and `<Name>` elements. It filters out names starting with `inspire_common:`, counts occurrences with `collections.Counter`, and prints each duplicated name or a success message. The tool accepts both remote URLs and local file paths through `argparse` and `urllib.request.urlopen`.
AI-generated description