Martin Desruisseaux created SIS-399:

             Summary: When renaming "xsi:type" value, may need to declare a new 
                 Key: SIS-399
             Project: Spatial Information Systems
          Issue Type: Bug
          Components: Metadata
    Affects Versions: 1.0
            Reporter: Martin Desruisseaux

{{TransformingReader}} converts XML element and attribute names from legacy 
standards to new standards, but there is one special case where instead of the 
attribute name, we need to convert attribute value: the {{xsi:type}} attribute. 

  <gmd:name xsi:type="gmd:PT_FreeText_PropertyType">
    <gco:CharacterString>Some text in default language</gco:CharacterString>
        <gmd:LocalisedCharacterString locale="#locale-fra">Same text in 

Conversion from legacy ISO 19139:2007 to new ISO 19115-3:2016 result in 
something like (omitting non-pertinent prefixes for this discussion):

  <…:name xsi:type="lan:PT_FreeText_PropertyType">
    <gco:CharacterString>Some text in default language</gco:CharacterString>
        <lan:LocalisedCharacterString locale="#locale-fra">Same text in 

{{gmd}} prefix has been replaced by {{lan}} prefix in various places, but this 
is not a concern for elements like {{lan:PT_FreeText}} because the {{XMLEvent}} 
created by {{TransformingReader}} already contain the full namespace URI. The 
problem is in the {{xsi:type}} value, where we do not specify the namespace 
ourselves. Attempts to unmarshal this converted XML result in an error message 
complaining the the {{lan}} prefix has not been bound. The workaround would be 
to replace the following fragment:

  <…:… xsi:type="gmd:PT_FreeText_PropertyType">


  <…:… xmlns:lan=""; 

In other words, we need to insert a local {{Namespace}} event which was not 
present in the original XML document.

This message was sent by Atlassian JIRA

Reply via email to