Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
eLink Information Integrator Doc Home | BEA eLink Information Integrator 1.0 User's Guide | Previous Topic | Next Topic | Contents | Index

MFL Document Type Definition

The following sections contain the MFL document type definition (mfl.dtd) and an example MFL document built using mfl.dtd.

mfl.dtd

mfl.dtd is shown in Listing B-1.

Listing B-1 mfl.dtd

>     <!--

>     Note: MessageFormatSet is not currently supported. All MFL docs must begin with MessageFormat as the root element.

>     -->

>     <!ELEMENT MessageFormatSet ( MessageFormat+ ) >

>     <!ELEMENT MessageFormat    ( StructFormat | StructFormatRef | FieldFormat )+ >

>     <!ELEMENT StructFormat     ( StructFormat | StructFormatRef | FieldFormat )+ >

>     <!--

>     Note: StructFormatRef is not currently supported. If specified, this element is ignored.

>     -->

>     <!ELEMENT StructFormatRef  EMPTY >

>     <!ELEMENT FieldFormat      ( (TagField?,LenField? ) | (LenField?,TagField? ) ) >

>     <!ELEMENT TagField         EMPTY >

>     <!ELEMENT LenField         EMPTY >

>     <!ENTITY % dataTypes

>         "(Literal

>             | String | Numeric

>             | Binary | EBCDIC

>             | Packed | UPacked

>             | ZonedDecimal | UZonedDecimal

>             | BigEndian2 | BigEndian4

>             | UBigEndian2 | UBigEndian4

>             | LittleEndian2 | LittleEndian4

>             | ULittleEndian2 | ULittleEndian4

>             | BigSwapEndian2 | BigSwapEndian4

>             | UBigSwapEndian2 | UBigSwapEndian4

>             | LittleSwapEndian2 | LittleSwapEndian4

>             | ULittleSwapEndian2 | ULittleSwapEndian4

>             | Date | Time | DateTime

>             | mmddyy | mmddyyyy | mmddyyhhmi | mmddyyhhmiss

>             | Smmddyy | Smmddyyyy | SCmmddyyhhmi

>             | SCmmddyyhhmipm | SCmmddyyhhmiss | SCmmddyyhhmisspm

>             | ddmonyy | ddmonyyyy

>             | Sddmmyy | Sddmmyyyy | SCddmmyyhhmi | SCddmmyyhhmipm

>             | SCddmmyyhhmiss | SCddmmyyhhmisspm

>             | Dddmonyy | Dddmonyyyy | Dmonyy

>             | Dmonyyyy | monyy | monyyyy | monddyyyy

>             | hhmiss | Chhmipm | Chhmi | Chhmisspm | Chhmiss

>             )">

>     <!ENTITY % baseTypes "(String | Numeric | EBCDIC)">

>     <!ENTITY % lenTypes

>         "(Literal

>             | String | Numeric

>             | Binary | EBCDIC

>             | Packed | UPacked

>             | ZonedDecimal | UZonedDecimal

>             | BigEndian2 | BigEndian4

>             | UBigEndian2 | UBigEndian4

>             | LittleEndian2 | LittleEndian4

>             | ULittleEndian2 | ULittleEndian4

>             | BigSwapEndian2 | BigSwapEndian4

>             | UBigSwapEndian2 | UBigSwapEndian4

>             | LittleSwapEndian2 | LittleSwapEndian4

>             | ULittleSwapEndian2 | ULittleSwapEndian4

>             )">

>     <!ENTITY % boolean "(y | n | true | false | yes | no)">

>     <!ENTITY % accessModes "(Normal | Current | Next |

>                              Controlling | Relative | Increment)" >

>     <!ATTLIST MessageFormatSet>

>     <!ATTLIST MessageFormat   name            NMTOKEN      #REQUIRED>

>     <!--

>     StructFormat Notes: If a structure is repeating, only one of 'repeat', 'repeatField', or 'repeatDelim' may be specified.

>     -->

>     <!ATTLIST StructFormat    name            CDATA      #REQUIRED

>                               repeat          CDATA        '0'

>                               repeatField     CDATA        #IMPLIED

>                               repeatDelim     CDATA        #IMPLIED

>                               delim           CDATA        #IMPLIED

>                               alternative     %boolean;    'n'

>                               optional        %boolean;    'n' >

>     <!--

>     Note: StructFormatRef is not currently supported. If specified, this element is ignored.

>     -->

>     <!ATTLIST StructFormatRef messageFormat   CDATA      #REQUIRED

>                               repeat          CDATA        '0'

>                               repeatField     CDATA        #IMPLIED

>                               repeatDelim     CDATA        #IMPLIED

>                               optional        %boolean;    'n' >

>     <!--

>     FieldFormat Notes: The basetype and cutoff attributes are only valid for date types. The value attribute is only valid for Literal types. The length attribute is only valid for types 'String', 'Numeric', 'EBCDIC', and 'Binary'.

>     -->

>     <!ATTLIST FieldFormat     name            CDATA       #REQUIRED

>                               type            %dataTypes;   'String'

>                               basetype        %baseTypes;   'String'

>                               cutoff          CDATA         '50'

>                               length          CDATA         #IMPLIED

>                               delim           CDATA         #IMPLIED

>                               value           CDATA         #IMPLIED

>                               optional        %boolean;     'n'

>                               accessMode      %accessModes; 'Normal'

>                               controlName     CDATA         #IMPLIED

>                               source          CDATA         #IMPLIED >

>     <!ATTLIST TagField        type            %dataTypes;   #REQUIRED

>                               value           CDATA         #REQUIRED>

>     <!ATTLIST LenField        type            %lenTypes;    #REQUIRED

>                               length          CDATA         #IMPLIED>

Example MFL Document

An example MFL document is shown in Listing B-2. This document was built using mfl.dtd. The example defines a message containing employee data.

Listing B-2 Example MFL Document

>     <?xml version='1.0'?>

>     <!DOCTYPE MessageFormat SYSTEM `mfl.dtd'>

>     <MessageFormat name='EMPLOYEES_MSG'>

>         <StructFormat name='EMPLOYEE'>

>             <FieldFormat name='EMP_ID' type='BigEndian4'/>

>              <StructFormat name='NAME'>

>                 <FieldFormat name='LAST_NAME' type='String' delim=', `/>

>               <FieldFormat name='FIRST_NAME' type='String'/>

>         	  </StructFormat>

>             <FieldFormat name='START_DATE' type='Sddmmyy'
>              basetype='String' cutoff='70'/>

>             <FieldFormat name='RATE' type='String' delim='.'>

>               <TagField type='String' value='SALARY=$'/>

>             </FieldFormat>

>         <StructFormat name='EMP_PIC' optional='true'>

>      	<FieldFormat name='TITLE' type='Literal'
>     	 value='--- Picture ---'/>

>            <FieldFormat name='PICTURE' type='Binary'>

>                <LenField type='BigEndian4'/>

>            </FieldFormat>

>         </StructFormat>

>            <FieldFormat name='NUM_PHONES' type='BigEndian4'/>

>             <StructFormat name='EMP_PHONES' repeatField="NUM_PHONES">

>               <FieldFormat name='PHONE_NUMBER' type='String'
>     	    length='10'/>

>             </StructFormat>

>         </StructFormat>

>     </MessageFormat>

Notes: The name of the message definition, EMPLOYEES_MSG, is given in the name attribute of the MessageFormat element. The field EMP_ID is defined as a BigEndian4 integer by the next FieldFormat element. The name of an employee is defined with two fields: LAST_NAME and FIRST_NAME. Note that a comma and a space delimit the LAST_NAME field (delim attribute of LAST_NAME).

The START_DATE field is a date string that is not Y2K compliant. The cutoff attribute of this field specifies that any two-digit year greater than 70 is prefixed with 19.

The field RATE defines a tag of SALARY=$, which will always precede RATE data. The field PICTURE defines a length field that precedes the PICTURE data. This length field specifies how many bytes the PICTURE data contains.

The field NUM_PHONES is used to specify how many instances of the field PHONE_NUMBER exist at run-time. This is done by specifying NUM_PHONES as the repeatField for the StructFormat EMP_PHONES.

Listing B-3 is an example instance of the message EMPLOYEES_MSG.

Listing B-3 Instance of EMPLOYEES_MSG

>     \x00\x00\x04\x20Doe, Jane\x0023/01/99SALARY=$56500.--- Picture ---\x00\x00\x00\x03:-}\x00\x00\x00\x0297294351019729435102

Notes: Each byte of the EMP_ID data is represented with the \x prefix to indicate it is hexadecimal. This is done for illustration purposes only. The value of the EMP_ID data is 1056.

The NAME data (Doe, Jane) follows EMP_ID. This data is terminated by the NULL character \x00 (the default for String types).

The 23/01/99 string is the START_DATE for this employee.

The RATE field is preceded with the tag SALARY=$. The RATE data is 56000 and is delimited with a period.

The literal `--- Picture ---' follows. The length field for the PICTURE data is represented with the \x prefix as before. The length of the PICTURE data is given as 3 bytes. The PICTURE data :-} then follows.

The field NUM_PHONES is given by the hexadecimal representation \x00\x00\x00\x02, which is a value of 2. This indicates that there are two instances of PHONE_NUMBER data: 972-943-5101 and 972-943-5102.

Copyright © 2000 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.