lutaml / shale

Shale is a Ruby object mapper and serializer for JSON, YAML, TOML, CSV and XML. It allows you to parse JSON, YAML, TOML, CSV and XML data and convert it into Ruby data structures, as well as serialize data structures into JSON, YAML, TOML, CSV or XML.
https://shalerb.org/
MIT License
0 stars 1 forks source link

XML namespace parse overriding or handling multiple namespaces inside one class #4

Open ronaldtse opened 3 months ago

ronaldtse commented 3 months ago

Some XML namespaces are versioned, based on the same prefix. In this case, when encountering a more generic prefix, the parser should still allow parsing:

e.g. The latest OGC GML namespace is xmlns:gml="http://www.opengis.net/gml/3.2", but there are many who use xmlns:gml="http://www.opengis.net/gml".

There should be a way to override the namespace in parsing instead of gsubing the content prior to parse?

The workaround right now is:

xml_content.gsub('xmlns:gml="http://www.opengis.net/gml"', 'xmlns:gml="http://www.opengis.net/gml/3.2"')