Element: ELEMENT

According to the XML terminology, an elementis an XML fragment enclosed between matching<...>and</...>markers. The meta-definition file describes the structure of validelements.

It contains three main components:

Attributes

Name Type Optional
NAME STRING No Name of the element. This name will be used to refer to the element. It will also be used as TAG name for the corresponding XML structure unless overridden by a TAG attribute.

In other words, an element named PERSON will be parsed by looking for <PERSON> and </PERSON> markers in the XML input to parse.

TYPEID STRING Yes If set, this attribute will be used to identify the element in polymorphic references, with "xsi:type=" prefixes. If not set, the name of the element will be used by default.
SHORTDESC STRING Yes If set, this attribute's value overides the element's name when a label must be built for a user interface.
TAG STRING Yes TAG of the element, that is the sequence of characters used to enclosed the element in a matching <...> an </...> pair.

If this attribute is not set, the element name is used as default tag name.

PREFIXFIELD STRING Yes If set, this attribute must refer to a string field defined whithin its enclosing element, and which will receive the prefix (all the text which appeared before the opening tag, DTD, comment, etc.) when the element is the top-level element of the document to parse.
PSEUDOELEMENT BOOLEAN Yes If set to TRUE, this attribute causes this element to be considered as a pseudo-element rather than a plain element. A pseudo-element maps to a data structure, has a grammar formula, but it is not a true element, in the sense that it has no leading nor closing tag, and consequently, it has no attribute either.
OVERRIDE STRING Yes By default, the structure (or type, or class, depending on the target language at hand) that represents an element is named using the name of the element. For instance, in Delphi, an element found between <PERSON> and </PERSON> markers will be represented by a class named TPERSON (using the common Delphi convention of using a T prefix for types).
By using the OVERRIDE attribute, one can change this behaviour and specify a different name to be used in the target language, for instance if the name of the element conflicts with one of the reserved words of the language.
PREFIX STRING Yes
POSTFIX STRING Yes
MAIN BOOLEAN Yes This attribute should hold a boolean TRUE value if the enclosing element is a valid top-level element. An element which is not a top-level element can only occur as part of another element.
ABSTRACT BOOLEAN Yes This attribute indicates that the element should only serve as base element for other elements, and should not exist on its own.
BASECLASS STRING Yes Pro version only If set, this attribute gives the base class to be used to the type that will represent the element. If the host language is not object-oriented (C and COBOL) this attribute is ignored. If the host language is object-oriented (Delphi, Java and YAFL) it is the user's responsibility to ensure that the class name given by this attribute is valid and visible. This base class must inherit from the default base class for elements for the host language at hand.
BASEELEMENT STRING Yes Pro version only If set, this attribute gives the base element to be used for this element. The base element name must refer to a valid element defined within the same meta-definition.

The new element will be defined by performing a number of operations:

  • The data structures will be concatenated (just as common inheritance does
  • The attributes sets will be merged
  • The new formula will be built by concatenating the two existing formulas
Besides, when this feature is used to define inheritance hierarchies among elements, polymorphic element references can be used.
IGNOREALIENATTRS BOOLEAN Yes Pro version only If set to TRUE, this attributes causes the XMLBooster-generated parser to accept (and ignore) alien attributes, that is, attributes that are not defined within the meta-definition file.
RECOVERY BOOLEAN Yes Pro version only If set to TRUE, this attributes causes the XMLBooster-generated parser to enable error-recovery mechanism for this element. In any case, this attribute can be used to override the RECOVERY attribute as defined at the system level.

Content

Sequence of
META
Optional ELEMENTGUIINFO
Sequence of
FIELDS
Optional ATTRIBUTES
Optional FORMULA
Optional LINEFORMAT

Appears in

SYSTEM

DTD declaration

<!ELEMENT ELEMENT
((META)*, ELEMENTGUIINFO?, (FIELDS)*, ATTRIBUTES?, FORMULA?, LINEFORMAT?)
>

<!ATTLIST ELEMENT
NAME CDATA #REQUIRED
TYPEID CDATA #IMPLIED
SHORTDESC CDATA #IMPLIED
TAG CDATA #IMPLIED
PREFIXFIELD CDATA #IMPLIED
PSEUDOELEMENT (TRUE|YES|yes|Y|y|ON|On|on|true|True|1|FALSE|NO|no|N|n|OFF|Off|off|false|False|0) #IMPLIED
OVERRIDE CDATA #IMPLIED
PREFIX CDATA #IMPLIED
POSTFIX CDATA #IMPLIED
MAIN (TRUE|YES|yes|Y|y|ON|On|on|true|True|1|FALSE|NO|no|N|n|OFF|Off|off|false|False|0) #IMPLIED
ABSTRACT (TRUE|YES|yes|Y|y|ON|On|on|true|True|1|FALSE|NO|no|N|n|OFF|Off|off|false|False|0) #IMPLIED
BASECLASS CDATA #IMPLIED
BASEELEMENT CDATA #IMPLIED
IGNOREALIENATTRS (TRUE|YES|yes|Y|y|ON|On|on|true|True|1|FALSE|NO|no|N|n|OFF|Off|off|false|False|0) #IMPLIED
RECOVERY (TRUE|YES|yes|Y|y|ON|On|on|true|True|1|FALSE|NO|no|N|n|OFF|Off|off|false|False|0) #IMPLIED
>