Hello SIS developers,,

I am working on updating Apache SIS to support ISO 19115-3 in addition to ISO
19139, and  I have run into an issue with the gco:nilReason attribute not
properly unmarshalling or marshalling in certain situations.

For example, when unmarshalling the following ISO 19139 XML snippet,
JAXB passes
the setVersion method in DefaultFormat.java (which takes an
InternationalString as its argument) a null value.

<gmd:MD_Format>
    <gmd:name>
        <gco:CharacterString>XML</gco:CharacterString>
    </gmd:name>
    <gmd:version gco:nilReason="missing" />
</gmd:MD_Format>

When I marshal the generated Java object back into ISO 19139 XML, I
get the following
output:

<gmd:MD_Format>
    <gmd:name>
        <gco:CharacterString>XML</gco:CharacterString>
    </gmd:name>
</gmd:MD_Format>

Notice that the version element is no longer present, meaning the
nilReason attribute
was lost. It seems to me that this is occurring during unmarshalling, since
the setter for version is just passed a null value.

How, then, can I get SIS to take the nilReason attribute into account so that
my output perfectly matches my input? I took a look at NilReason.java and
some related classes, but I can't seem to figure out how they are used in
practice.

If there is a fix, I will likely need to apply it to other attributes in
the future. So, please let me know if the fix for this issue can be
generalized to other attributes.

Thank you,
Cullen Rombach

-- 
Cullen Rombach
Image Matters LLC
www.imagemattersllc.com

Reply via email to