Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Representing temp-tables in XML Schema

> Temp-tables are represented with an XML Schema element definition, followed by a complex type definition defining the fields. The XML Schema name attribute identifies the name of the temp-table. The following Progress-specific XML Schema attributes further describe the temp-table:

> - `undo` — identifies the temp-table as `UNDO`

> - `beforeTable` — specifies the name of any before-image table for this temp-table

> - `bufferName` — If the XML Schema is written for a non-default buffer of a temp-table, this attribute specifies the buffer name.

> Temp-table fields can be represented as elements, attributes or text in an XML Document. The `XML-NODE-TYPE` attribute on the buffer-field object lets you control how fields are represented in the XML document and the XML Schema.

> XML Schema provides the following built-in attributes for minimally describing a temp-table field in an element definition (when the buffer-field has an `XML-NODE-TYPE` of `"ELEMENT"`):

> - `name` — name of the field.

> - `type` — data type of the field.

> - `minOccurs/maxOccurs` — extent of array fields.

> - `nillable` — can be null or unknown (always has a value of `"true"` for temp-table fields). Unknown fields have `xsi:nil` attribute set to `"true"` in the XML instance.

> - `default` — the initial value for the field. If the field has the default initial value for it's data type (for example, `0` for integer), the attribute will not be present in the XML Schema.

> XML Schema provides the following attributes for attribute definitions (when the buffer-field has a `XML-NODE-TYPE` of `"ATTRIBUTE"`):

> - `name` — name of the field

> - `type` — data type of the field

> - `default` — the initial value for the field. If the field has the default initial value for it's data type (for example, `0` for integer), the attribute will not be present in the XML Schema.

> XML Schema provides the following attribute for simple content definitions (when the Buffer-field has a `XML-NODE-TYPE` of `"TEXT"`):

> - `type` — data type of the field.

> Notes: If you want to be able to explicitly set a field to the Unknown value (`?`) (`xsi:nil="true"`), it must have `XML-NODE-TYPE = "ELEMENT"
> `
> Array fields must have `XML-NODE-TYPE = "ELEMENT"` or`"HIDDEN"
> `
> Buffer fields with `XML-NODE-TYPE="TEXT"` cannot be part of a nested `DATA-RELATION`.

> Progress provides the following XML Schema extensions for describing Progress-specific attributes of a temp-table field. These attributes, with the exception of `dataType` and `initial`, will only appear in the XML Schema when the `min-xmlschema` option for `WRITE-XML()` method or `WRITE-XMLSCHEMA()` method is `FALSE`.

> Table 22–8: Progress XML Schema extensions for temp-table fields
> XML Schema attribute | Description
> --- | ---
>     caseSensitive
> | Case-sensitive for `CHARACTER` fields
>     columnCodepage
> | Column-codepage for `CLOB` fields
>     columnLabel
> | Column-label for the field
>     dataType
> | The Progress data type for fields where the XML Schema type attribute maps to multiple Progress data types (for example, `string`, `base64Binary`, `dateTime`). See Appendix D "XML Reference of Data Type and Code Page mappings."
>     decimals
> | Number of decimal places for `DECIMAL` fields
>     format
> | Display format for the field
>     fieldName
> | Name of the field. Used only for fields with `XML-NODE-TYPE` of `"TEXT"`
>     help
> | Help text for the field
>     initial
> | Initial value for the field. Used for fields with `XML-NODE-TYPE` of `"TEXT"`, and for fields with initial value of `TODAY`, `NOW` or `UNKNOWN`.
>     label
> | Label for the field
>     readOnly
> | Read-only attribute for the field
>     userOrder
> | Position of the field in the temp-table. This attribute is used only when there's a mix of fields with `XML-NODE-TYPE` of `"ELEMENT"` and `"ATTRIBUTE"` in the temp-table.

> Note: If any of the above Progress-specific field attributes have the Progress default value, `WRITE-XML()` method and `WRITE-XMLSCHEMA()` method will omit the attribute from the element or attribute definition when it writes the XML Schema.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095