Defining object type descriptive and short names

Build 1501 on 14/Nov/2017  This topic last edited on: 21/Mar/2016, at 18:36

Defining the descriptive name

The descriptive name of objects are specified using the GN4-specific extension attribute ‘descName’; that applies to the ‘complexType’ elements in the schema.  The value of the ‘descName’ attribute is an XPath expression computing the value of the descriptive name from the object attributes values.

This example defines an object type ‘test’ with a string attribute ‘location’ and a descriptive name equal to the value of the ‘location’ attribute.

<xs:element name="test">

<xs:complexType gs:descName="@location">

 <xs:complexContent>

   <xs:extension base="object">

     <xs:attribute

      name="location"

      type="xs:string"/>

   </xs:extension>

 </xs:complexContent>

</xs:complexType>

</xs:element>

 

Descriptive name definitions can be inherited, e.g.:

<xs:complexType name="object" gs:descName="@name">

  <xs:attribute name="id" type="xs:ID" />

  <xs:attribute name="name" type="tName" />

</xs:complexType>

 

<xs:element name="test">

 <xs:complexType>

   <xs:complexContent>

     <xs:extension base="object">

       <xs:attribute

        name="location"

        type="xs:string"/>

     </xs:extension>

   </xs:complexContent>

 </xs:complexType>

</xs:element>

 

defines the same object type ‘test’ but with the value of the ‘name’ (inherited) attribute as the descriptive name – definition inherited from the parent object type ‘object’.

IMPORTANT: The definition of a descriptive name is compulsory. Every object type must have one – either defined directly or inherited.

Defining the short name

Similarly, objects short names are specified using the GN4-specific extension attribute ‘shortName’; that applies to the ‘complexType’ elements in the schema.  The value of the ‘shortName’ attribute is an XPath expression computing the value of the descriptive name from the object attributes values.

<xs:element name="test">

 <xs:complexType gs:shortName="@location">

   <xs:complexContent>

     <xs:extension base="object">

       <xs:attribute

        name="location"

        type="xs:string"/>

     </xs:extension>

   </xs:complexContent>

 </xs:complexType>

</xs:element>

 

The example above defines an object type ‘test’ with a string attribute ‘location’ and a short name equal to the value of the ‘location’ attribute.

The definition of a short name is optional. If not specified, the descriptive name will be used as the short name.

See also

Attribute name

Editorial objects names