Some FlexQuery functions working with DSM (Data Source Model) elements use such a specification as a parameter to filter elements to be included in the result of a certain operation (e.g. searching or filtering).
The list of matching Element Types can be defined as:
ET1 | ET1 | ... | ETn
ETn
is the name of a different Element Type.
*
), which matches all elements regardless of their type
Each Element Type name provided in the specification must be uniquely resolvable to a certain Element Type found in the DSM Type, which the given template is associated with. If that is not the case, an error will be raised.
When an XML file based on such an XML schema is parsed, the association of particular XML elements found in it with their types defined in the XML schema is done according to the context, where the given XML element is found (depending on the types of its ancestor elements).
To deal with that problem, for each Element Type, besides its original name obtained from the XML schema (which is called here local name),
the XML Type Driver generates also a unique global name.
For more details, please see: Generator Object Model | Object Types | GOMElementType.globalName
.
Exactly that global name should be used to identify the particular Element Type in most Matching Element Type specifications. However, there are two special cases:
Most frequently, that applies when writing location paths made of child steps.
It is also applicable for FlexQuery functions like findChild()
and similar, when the type of the contextElement
actual in that expression is known on the moment of designing the template.
~localName
For example, the call like:
instanceOf (
"xs:restriction |
xs:restriction%xs:complexRestrictionType |
xs:restriction%xs:simpleRestrictionType"
)
can be replaced with just:
instanceOf("~xs:restriction")
"Class"
"Class | Method | Field"
"*"