Skip to content

Transforming Codelists from 19139 to 19115 3

Ted Habermann edited this page Aug 22, 2015 · 3 revisions

The ISO metadata standards include many codeLists that play the role of extensible shared vocabularies. CodeLists are extended by defining a location for the codeList and a value from that list. The form of the codeList elements in 19139 is

<gmd:CI_DateTypeCode codeList="codeListLocation#codeListName" 
codeListValue="codeListValue"> codeListValue</gmd:CI_DateTypeCode>

The repetition of the codeListValue as an attribute (e.g. @codeListValue) and as the value of the code list element is done so that tools that are reading the metadata will find the value regardless of which location they are using. This is good defensive xml. Unfortunately, this approach is a convention, i.e. not required by the schema.

The ambiguity about the location of this information causes a problem in the transform - which location should be used? The ambiguity can not be resolved by taking A | B because this expression will yield two values when the codeList is written according to the convention. If the two values are the same, it doesn't matter which is selected, but if they are different, there is no clear way to systematically choose the correct one.

The solution I have chosen is to use the @codeListValue in the transform. This means the transform works unless there is no @codeListValue value.