Note: The notion of Local Element Types is currently used only for XML file data sources (supported in DocFlex/XML product line).
Local Element Types are those defined locally within the scope of other Element Types.
Unlike, global Element Types, whose names are unique for the whole DSM (Data Source Model) Type, the names of local Element Types are unique only within the scope of their parents. Therefore, several absolutely different local Element Types in the DSM may share the same name, which makes them difficult to refer.
To handle this problem, for each Element Type, DocFlex generates a special
global name (see GOMElementType.globalName
property),
which is unique for the whole DSM. Further, the Element Type is referred by
that global name in every situation that may be ambiguous.
For each global Element Type, its global name is the same as the local (normal) name;
see GOMElementType.name
property.
The global names of local Element Type is are provided by the DSM Type driver (which is a special module that connects the DocFlex core to the particular data source).
In the case of an XML-file DSM Type initialized from a certain W3C XML Schema
(which is currently the only situation when local Element Types may appear),
each local Element Type represents a certain local element component
declared in the XML schema using an <xs:element>
element nested within
the definition of a certain other component: a global <xs:complexType>
,
global <xs:group>
or another <xs:element>
.
The global name of such an Element Type is generated according to the following rules:
(I)
When the Element Type's local name is unique for the whole DSM Type,
that name will be also the global name of that Element Type.
(II)
When the corresponding <xs:element>
definition is based entirely on a certain global complexType/simpleType and looks like:
the Element Type's global name will be produced as the following:<xs:element name="name" type="typeName"/>
(III)name%typeName
When the type of the local element
is defined anonymously within the <xs:element>
, which may look like this:
the global name of the corresponding Element Type will be generated according to where that definition is located:<xs:element name="name"> <xs:complexType> ... </xs:complexType> </xs:element>
<xs:complexType>
with
the name 'type_name'
, the Element Type's global name will be this:
%type_name$name
<xs:group>
with
the name 'group_name'
, the Element Type's global name will be this:
!group_name$name
<xs:element>
definition is nested within
another <xs:element>
definition
whose corresponding Element Type has the global name 'parent_global_game'
,
then the global name of the given local Element Type will be produced as:
That is, it will be represented as the full paths formed from names of nested schema components separated with '$' starting from a certain global component until the given localparent_global_name$name
<xs:element>
definition. For example:
DeliveryContact$Address$City