RainCode - XMLBooster

Element: ATTR

The data structure which is built when recognizing an instance of an element can extract information from the formula as well as from attributes.

Attributes

Name Type Optional
NAME STRING No Name of the attribute as it will be found in the XML input to parse.
TARGET STRING Yes

If specified, the value of this attribute must refer to a field defined within the same element, and which will receive the value parsed by the XMLBOOSTER-generated parser. The way this fetch operation will occur in practice will depend mostly on the target field type specication.

If no target attribute is specified, the parser generated by XMLBOOSTER will skip the attribute without fetching the attached value.

VALUE STRING Yes
OPTIONAL BOOLEAN Yes Indicates whether the attribute is optional or not. Default is FALSE.
ENTITIESINATTR BOOLEAN Yes This attribute indicates whether entities (starting with the "&" character) must be recognized in this attribute. While this is the standard behaviour of XML, allowing for a simpler parsing method when dealing with messages in which one knows that entities will not be required can deliver a significant performance advantage. The value indicated in this attribute overriddes the value given in the meta-definition header.
FIXED BOOLEAN Yes

Content

Sequence of
META

Appears in

ATTRIBUTES

Example

<?xml version="1.0"?>
<!DOCTYPE SYSTEM SYSTEM "metaxmlb.dtd">
<SYSTEM NAME="Agenda">
        <COBOLCONFIG USECLASSPREFIX="TRUE"
                     NUMBERLINES="6"
                     DATAPREFIX="a"
                     MAXLEN="40"
                     ARRAYSIZE="40"/>
        <CCONFIG MAXLEN="100"
                 ARRAYSIZE="5"
                 FLATMODE="TRUE"/>
        <DELPHICONFIG COLLECTIONSTART="ONE">
    </DELPHICONFIG>
        <ASMCONFIG
            PASTEPRELUDE="xmlbmacros.Txt">
                <PRELUDE></PRELUDE>
                <POSTLUDE>          END</POSTLUDE>
        </ASMCONFIG>
        <JAVACONFIG PACKAGE="Agenda" COLLECTIONCLASS="ArrayList" COLLECTIONSTART="ZERO">
                <IMPORT>
      /////////////////////////////////////
      // Automatically inserted import list
      /////////////////////////////////////
      import java.util.*;
    </IMPORT>
        </JAVACONFIG>
        <YAFLCONFIG>
                <IMPORT></IMPORT>
        </YAFLCONFIG>
        <CPPCONFIG COLLECTIONCLASS="vector" STRINGCLASS="string">
        <INCLUDES>
      #include <vector.h>
      #include <stl_string.h>
        </INCLUDES>
        </CPPCONFIG>
        <ELEMENT NAME="AGENDA" MAIN="YES">
                <FIELDS>
                        <FIELD NAME="Entries" REFTYPE="ENTRY" MODE="LIST"/>
                </FIELDS>
                <FORMULA>
                        <REPEAT TARGET="ENTRIES" ATLEASTONE="TRUE">
                                <ELEMENTREF NAME="ENTRY"/>
                        </REPEAT>
                </FORMULA>
        </ELEMENT>
        <ELEMENT NAME="ENTRY">
                <FIELDS>
                        <FIELD NAME="Day" TYPE="INTEGER"/>
                        <FIELD NAME="Month" TYPE="INTEGER"/>
                        <FIELD NAME="Year" TYPE="INTEGER"/>
                        <FIELD NAME="Who" TYPE="PCHAR" />
                        <FIELD NAME="Status" ENUMTYPE="ENTRYSTATUS"/>
                </FIELDS>
                <ATTRIBUTES>
                        <ATTR NAME="DAY" TARGET="Day" OPTIONAL="FALSE"/>
                        <ATTR NAME="MONTH" TARGET="Month" OPTIONAL="FALSE"/>
                        <ATTR NAME="YEAR" TARGET="Year" OPTIONAL="FALSE"/>
                        <ATTR NAME="WHO" TARGET="Who" OPTIONAL="FALSE"/>
                        <ATTR NAME="STATUS" TARGET="Status" OPTIONAL="TRUE"/>
                </ATTRIBUTES>
        </ELEMENT>
        <ENUM NAME="ENTRYSTATUS" PREFIX="" POSTFIX="">
                <ENUMVALUE NAME="Proposed"/>
                <ENUMVALUE NAME="Cancelled"/>
                <ENUMVALUE NAME="Confirmed"/>
    <ENUMVALUE NAME="Darius" />
    <ENUMVALUE NAME="Da" />
    <ENUMVALUE NAME="Double" />
    <ENUMVALUE NAME="D" />
        </ENUM>
</SYSTEM>

DTD declaration

<!ELEMENT ATTR
(META)*
>

<!ATTLIST ATTR
NAME CDATA #REQUIRED
TARGET CDATA #IMPLIED
VALUE CDATA #IMPLIED
OPTIONAL (YES|yes|Y|y|ON|On|on|TRUE|true|True|1|NO|no|N|n|OFF|Off|off|FALSE|false|False|0) #IMPLIED
ENTITIESINATTR (YES|yes|Y|y|ON|On|on|TRUE|true|True|1|NO|no|N|n|OFF|Off|off|FALSE|false|False|0) #IMPLIED
FIXED (YES|yes|Y|y|ON|On|on|TRUE|true|True|1|NO|no|N|n|OFF|Off|off|FALSE|false|False|0) #IMPLIED
>