Include 2 <targetElement> elements or update the current one?

Added by Michael Lutz about 6 years ago

If the <targetElement> information is not used by current tools and applications and hence a change in the type listed in this element would not break existing implementations, the <targetElement> could also simply be updated to the new type.

EXAMPLE Reference to the bui:Building and bu-base:AbstractConstruction types from the Address.building property

<element name="building" type="gml:ReferenceType" nillable="true" minOccurs="0" maxOccurs="unbounded">
  <annotation>
    <documentation> (…) </documentation>
    <appinfo>
      <targetElement xmlns="http://www.opengis.net/gml/3.2">bui:Building</targetElement>
      <targetElement xmlns="http://www.opengis.net/gml/3.2">bu-base:AbstractConstruction</targetElement>
    </appinfo>
  </annotation>
</element>

vs. reference to only the bu-base:AbstractConstruction type from the Address.building property:

<element name="building" type="gml:ReferenceType" nillable="true" minOccurs="0" maxOccurs="unbounded">
  <annotation>
    <documentation> (…) </documentation>
    <appinfo>
      <targetElement xmlns="http://www.opengis.net/gml/3.2">bu-base:AbstractConstruction</targetElement>
    </appinfo>
  </annotation>
</element>

Replies (1)

RE: Include 2 <targetElement> elements or update the current one? - Added by Pawel Soczewski about 6 years ago

In my opinion, if in XML schema are to be documented deprecated object types, this rule should apply to both object definitions as well as for the definitions of their attributes and associations roles.

If we follow the proposed approach, <targetElement> element should be encode like below:

<element name="building" type="gml:ReferenceType" nillable="true" minOccurs="0" maxOccurs="unbounded">
  <annotation>
    <documentation> (…) </documentation>
    <appinfo>
      <deprecated xmlns="http://inspire.ec.europa.eu/..." sinceVersion="3.1" sinceDate="2013-10-21" sup-portedUntil="2016-12-31">true</deprecated>
      <targetElement xmlns="http://www.opengis.net/gml/3.2">bui:Building</targetElement>
    </appinfo>
    <appinfo>
      <targetElement xmlns="http://www.opengis.net/gml/3.2">bu-base:AbstractConstruction</targetElement>
    </appinfo>
  </annotation>
</element>

The use of 2 <appinfo> elements allow tools supported <targetElement> to recognize which object is current.

(1-1/1)