Description
Apache SIS 1.0 can read and write XML documents for both the legacy ISO 19115:2003 metadata schema and the new ISO 19115:2014 schema. This is currently done by tricky code:
- FilteredStreamReader and FilteredStreamWriter replaces namespace URL on the fly. Some replacements are complicated because not a one-to-one relationship.
- Attributes that are present in one version and not in the other, or attributes that have been renamed between two different versions, are handled by private methods in metadata objects. Those private methods delegate to the public methods only under some conditions (whether we are marshalling or unmarshalling, and which version).
This is complicated. But doing the version conversions by Java code give more power than XSL. However after a few years the new metadata schema may become widespread enough that it is no longer worth to carry the weight of this complication. We should:
- Wait for GeoAPI 4.0 to be developed (we expect it to remove legacy ISO 19115:2003 methods) and published by OGC.
- Remove the deprecated metadata methods from Apache SIS. This is the SIS-380 task.
- In every org.apache.sis.metadata.iso classes where we had to implement some switch depending on whether we are marshalling the legacy or the new version, delete all that code and just put unconditional JAXB annotations on the public methods instead.
- Remove the Since2014 inner classes in code list adapters and property adapters. Make the adapter classes final again.
- Remove the code performing metadata namespace replacement in FilteredStreamReader and FilteredStreamWriter.
- Use the fromISO19139.xsl and toISO19139.xsl files instead.
XSL files are published at http://standards.iso.org/iso/19115/resources/transforms/ISO19139