Hello Frédéric
Thank you very much for your reply.
Le 11/12/13 13:50, Frédéric Houbie a écrit :
the xlink:href attribute is there to reference a linked information.
There are use cases where the value is an additional information to
the content of the element.
<gmd:keyword>
<gmx:Anchor xlink:href="http://vocab.ndg.nerc.ac.uk/term/C161/0/55"
xlink:actuate="onRequest">Bering Sea</gmx:Anchor>
</gmd:keyword>
In this case, the link points to some semantic description of the
term, which is the content of the element. That's the kind of case
where you need to keep both.
In my understanding (please correct me if I'm wrong), <gmx:Anchor> can
be used in places where a <gco:CharacterString> would normally be
expected [1]. In this particular case Apache SIS already keep both. I
was rather thinking about the cases where the xlink:href is used for
replacing a bigger ISO 19139 object, for example <gmd:MD_Keywords> as
whole. In such cases the xlink:href attribute appears higher in the
hierarchy.
So, I would say that the Java representation of such XML construct
shall keep the content, shall keep the link value and eventually
having some helper to resolve the link and maybe parse it.
Agree, Java representation in Apache SIS already keep both. My issue was
rather about which information to choose by default at marshalling time.
Unless someone makes an other proposal, I will try to change the default
behaviour in order to write xlink:href even if the object is non-nil.
This will lead to duplication in the XML file, but it may be a less
surprising behaviour for users than omitted information.
Thanks,
Martin
[1] http://www.schemacentral.com/sc/niem20/e-gmx_Anchor.html
[2]
http://www.schemacentral.com/sc/niem21/t-gmd_MD_Keywords_PropertyType.html