RainCode - XMLBooster

Element: ELEMENT

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

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.

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.

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 FIELDS
Optional ATTRIBUTES
Optional FORMULA

Appears in

SYSTEM

DTD declaration

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

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