2.10.3.3 Mapping XML To and From FML/FML32 Field Types
The relationship between the XML format and the FML/FML32 fields is one in which the XML element names are the same as the FML/FML32 field names, and the XML values are interpreted using the corresponding field type.
The opening and closing tag uses the name of the field. Attributes are optionally provided for FLD_FML32, FLD_MBSTRING
and FLD_VIEW32
. Field names and attributes are case sensitive.
The field value is read as a string and converted to the following field type:
<FIELDNAME Attribute="Attribute Value"> FIELDVALUE </FIELDNAME>
FML/FML32 field types are mapped to XML buffer types as follows:
Field Type | Conversion Mapping | Example |
---|---|---|
SHORT LONG CHAR FLOAT DOUBLE STRING | The FLD_SHORT, FLD_LONG, FLD_CHAR, FLD_FLOAT, FLD_DOUBLE , and FLD_STRING fields are simple conversions to and from the XML string values. Formatting of type values will follow the style, where possible, that has been used in Ftypcvt() .
|
|
CARRAY | During FLD_CARRAY field conversion, the XML byte stream value is converted from two alphanumeric characters in XML to one byte value in Tuxedo. That is, each XML pair of characters represents a hex byte value.
|
|
PTR | During conversion to XML, the FLD_PTR fieldname points to one of the following valid Tuxedo buffer types: STRING, MBSTRING, CARRAY, FML, FML32, and VIEW32 and ignores any invalid buffer types. When the buffer content is converted to XML, the BUFTYPE attribute is included in the buffer type tag (see example 1). During conversion to FML32, the BUFTYPE attribute must be included in the buffer type tag. The only valid values are Tuxedo buffer types: STRING, MBSTRING, CARRAY, FML,FML32, and VIEW32 . If the BUFTYPE attribute is not specified or an invalid value is used, the element is ignored in FML32.
|
Example 1 - XML Conversion: Example 2 - FML32 Conversion:
|
FML32 | The FLD_FML32 fieldname is supported with the opening and closing tags based upon the FML field name. This XML document includes multiple descriptions of <fieldname>value</fieldname> for each field contained in the buffer. Embedded FML32 is allowed so hierarchical XML descriptions are permitted.
Note: An optional attribute,Tpmbenc , can be used to specify the encoding for the entire MBSTRING field of FML32 buffers during XML to FML32 conversion
|
The first example below includes an encoding attribute and the second example is an FML32 definition for a BANK field containing an embedded FML32 field named ID.
Example 1:
Example 2: |
VIEW32 | The FLD_VIEW32 fieldname is supported, and therefore, the FLD_INT and FLD_DECIMAL fields are also recognized. FLD_INT is treated like FLD_LONG . The start and end tag is based on the FLD_VIEW32 field name. It will take a Vname attribute for specifying the view name to use. This XML document includes multiple descriptions of <fbname> value </fbname> where fbname is the buffer name of the view member field.
|
|
MBSTRING | The FLD_MBSTRING field conversion uses the Encoding attribute and the field data to describe the FML32 field. This conversion is similar to Fmbpack32 usage. Please note the following conditions:
FLD_CARRAY field.
|
|
Parent topic: Converting XML Data To and From FML/FML32 Buffers