Share via


Standard Data Record XML Structure

The following XML structures show the one-, two-, and three-tiered versions of the data record format, where element names link to a description of the contents of that element, and where the attributes of each element are shown in italic, without the equal sign and value that normally accompanies them. Required elements and attributes are shown in bold; optional elements and attributes are not in bold.

Ee823429.note(en-US,CS.10).gif Note

  • The XML elements and attributes in the standard data record format must be expressed in lowercase letters.

XML Structure

One-Tier Format

<documentrecordcount>
    <record>
        <dataid1>Value</dataid1>
        <dataid2>Value</dataid2>
        <dataid3>Enumeration value</dataid3>
        <dataid3_displayname>Display name for value</dataid3_displayname>
        ...
        <dataidN>Value</dataidN>
    </record>
    ...
    <record>
        <dataid1>Value</dataid1>
        <dataid2>Value</dataid2>
        <dataid3>Enumeration value</dataid3>
        <dataid3_displayname>Display name for value</dataid3_displayname>
        ...
        <dataidN>Value</dataidN>
    </record>
</document>

Two-Tier Format

<documentrecordcount>
    <record>
        <dataid1>Value</dataid1>
        <dataid2>Value</dataid2>
        <record>
            <dataid21>Value</dataid21>
            <dataid22>Value</dataid22>
        </record>
    </record>
</document>

Three-Tier Format

<documentrecordcount>
    <record>
        <dataid1>Value</dataid1>
        <dataid2>Value</dataid2>
        <record>
            <dataid21>Value</dataid21>
            <dataid22>Value</dataid22>
            <record>
                <dataid31>Value</dataid31>
                <dataid32>Value</dataid32>
            </record>
        </record>
    </record>
</document>

document

This required element is the XML root element within the XML data-island and contains the record elements, potentially nested to three levels in depth.

Parent Element

None (document root).

Required Child Elements

record (one or more)

Optional Child Elements

None.

Data

None.

Attributes

Attribute Description
recordcount Specifies the number of (top level) record elements contained by this element.

Required only by the ListSheet HTC so that it can properly update the page controls when using HTTP fetch operations. It is not used by any other HTCs and is ignored if present.

Legal values: positive integers, 0, and -1.

A value of 0 indicates an empty list. Such a list must contain a single record element containing empty sub-elements.

A value of –1 indicates a list of unknown size. The ListSheet HTC displays such lists as a multi-page list with an unknown number of pages.

Default value: None.

Return to XML Structure

record

This required element contains all the data for a particular record. This data is represented as a series of contained elements, one for each field in the record.

Parent Element

document

Required Child Elements

None.

Optional Child Elements

dataid, record

Data

None.

Attributes

None.

Remarks

There can be one or more record elements. The record element contains dataid elements, and for two- and three-tiered XML structures, other record elements.

Return to XML Structure

dataid

These elements contain the data to be displayed in a particular field in the associated HTC. No element with a particular name is required, though a record element without any contained dataid elements would not be a very interesting record.

Parent Element

record

Required Child Elements

None.

Optional Child Elements

None.

Data

The actual data value.

Attributes

None.

Remarks

The names of these elements typically originate as field names in the ADO Recordset object from which this XML structure is derived. The standard set of functions used to convert ADO Recordset objects to XML use the Recordset field name as the corresponding element name in the produced XML.

These names are also used to associate each data value with a particular column being displayed in a particular HTC. All HTCs that are passed a data-island in this format are also passed a corresponding data-island identified by the MetaXML container attribute. Data-islands of this latter type have elements that correspond to the data to be displayed. These elements describe the data, including such information as their data types. They also include an id attribute. The value of the id attribute should be the same as the name of the dataid element in the data-island associated with the DataXML container attribute.

The following table shows, for each HTC using a DataXML data-island of this format, the MetaXML element whose id attribute corresponds to the name of a dataid element in that data-island.

HTCs MetaXML Elements Notes
DynamicTable id attribute of boolean, date, numeric, select, text, and time elements. The value of the id attribute of one of the child elements of the fields element corresponds to a dataid element in the DataXML data-island.
EditField id attribute of boolean, date, numeric, select, text, and time elements. The value of the id attribute of one of the child elements of the fields element corresponds to a dataid element in the DataXML data-island.

It also corresponds to the value of the DataID container attribute.

EditSheet id attribute of boolean, date, numeric, select, text, and time elements. The value of the id attribute of one of the child elements of the fields element corresponds to a dataid element in the DataXML data-island.
ListEditor id attribute of boolean, date, numeric, select, text, and time elements. The value of the id attribute of one of the child elements of the fields element corresponds to a dataid element in the DataXML data-island.
ListSheet id attribute of column (columns) element.

id2 attribute of column (columns) element.

id3 attribute of column (columns) element.

id attribute of column (subobject) element.

The value of the dataid element can occur in these four distinct places in the corresponding MetaXML data-island, depending on the type of ListSheet HTC being employed.

For more information, see the detailed explanation at the beginning of this topic.

Return to XML Structure

dataid*,* dataid_displayname

These elements contain enumerated data to be displayed in a particular field in the associated HTC. No such element pairs sharing a particular name root (dataid) are required.

Parent Element

record

Required Child Elements

None.

Optional Child Elements

None.

Data

dataid: The actual data value.

dataid_displayname: The display name associated with the dataid element.

Attributes

None.

Remarks

Data for enumerated types is handled somewhat differently than other data types within the data-islands corresponding to the DataXML container attribute. The data value itself is formatted the same as the other types — as data contained within an element whose name serves to identify that data.

A display name associated with the enumerated type may be supplied in the data-island as data for another, sibling XML element. The name of the sibling element is the same as for the corresponding value, with the string "_displayname" appended to it.

For example, suppose that for a select element within the MetaXML data-island associated with an EditSheet HTC (or a column element with its format attribute set to "select" within the MetaXML data-island associated with a ListSheet HTC), the id attribute is set to "eyecolor". In the corresponding DataXML data-island, there should be elements that look like the first line in the following example, and there can optionally be lines like the second line in the following example:

    <eyecolor>3</eyecolor>
    <eyecolor_displayname>Blue</eyecolor_displayname>

In this example, the value "3" corresponds to blue eyes, and the string "Blue" is displayed to the user.

If the DataXML data-island does not contain the _displayname variety of elements, the HTC inserts such elements into the DataXML data-island. This is accomplished through the following series of steps:

  1. Search the MetaXML data-island for a select element with an id attribute that matches the data element name from the DataXML data-island.

  2. If such a select element is found, search its option elements for one that has a value attribute with a value equal to the actual data in the DataXML data-island.

  3. If such an option element is found, use its data value as the data contained in the newly inserted data_element_name_displayname element.

In some situations the page itself will have to set the proper _displayname elements because there are more than one possible select elements within the MetaXML data-island that might need to be searched. Which one should be used probably depends on some other setting on the page, which only that page is in a position to know. For an example of this behavior, see the page Regionaltax.asp in the Tax module. This page contains a DynamicTable HTC with two select fields that must be kept synchronized.

Return to XML Structure


All rights reserved.