Information Center

Types of XML file

Z and I Emulator for Web and Database On-Demand support two types of XML file:

The format of a DTD XML file

A DTD XML file contains:

The purpose of the DatabaseOnDemand Data Type Definition (DTD) is to allow programs that read XML files (such as XML editors) to validate the contents of the XML file against the DTD. The DatabaseOnDemand DTD is defined as follows:

<!DOCTYPE DatabaseOnDemand [
<!ELEMENT DatabaseOnDemand (QUERY)>
<!ELEMENT QUERY (ROW+)>
<!ELEMENT ROW (COLUMN+)>
<!ELEMENT COLUMN (#PCDATA)>
<!ATTLIST COLUMN NAME CDATA #REQUIRED>
<!ATTLIST COLUMN VALUE CDATA #REQUIRED>
]>

The following text shows some sample XML data created in accordance with the DatabaseOnDemand DTD:

<DatabaseOnDemand>
  <QUERY>
    <ROW>
      <COLUMN NAME="TOPICID" VALUE="9" />
      <COLUMN NAME="EXAMPLID" VALUE="54" />
      <COLUMN NAME="DESCRIPT" VALUE="Employee Sales" />
      <COLUMN NAME="OBJECTID" VALUE="19" />
    </ROW>
    <ROW>
      <COLUMN NAME="TOPICID"  VALUE="12" />
      <COLUMN NAME="EXAMPLID"  VALUE="74" />
      <COLUMN NAME="DESCRIPT"  VALUE="Total Sales" />
      <COLUMN NAME="OBJECTID"  VALUE="22" />
    </ROW>
   </QUERY>
</DatabaseOnDemand>
In the above example, TOPICID, EXAMPLID, DESCRIPT, and OBJECTID are the column names from the host database.

The format of an Excel XML file

The Excel XML file can be opened and modified by Microsoft Excel 2003.

Below is a sample of an Excel XML file:

<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook
  xmlns="urn:schemas-microsoft-com:office:spreadsheet"
  xmlns:o="urn:schemas-microsoft-com:office:office"
  xmlns:x="urn:schemas-microsoft-com:office:excel"
  xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
  xmlns:html="http://www.w3.org/TR/REC-html40"
  xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml"
  xmlns:udc="http://schemas.microsoft.com/data/udc"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile">
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  </DocumentProperties>
  <Worksheet ss:Name="Sheet1">
    <Table>
      <Column ss:Width="200"/>
      <Column ss:Width="200"/>
      <Column ss:Width="200"/>
      <Row ss:AutoFitHeight="0">
        <Cell>
          <Data ss:Type="String">SRCSEQ</Data>
          <NamedCell ss:Name="_FilterDatabase"/>
        </Cell>
        <Cell>
          <Data ss:Type="String">SRCDAT</Data>
          <NamedCell ss:Name="_FilterDatabase"/>
        </Cell>
        <Cell>
          <Data ss:Type="String">SRCDTA</Data>
          <NamedCell ss:Name="_FilterDatabase"/>
        </Cell>
      </Row>
      <Row ss:AutoFitHeight="0">
        <Cell>
          <Data ss:Type="Number">1.00</Data>
          <NamedCell ss:Name="_FilterDatabase"/>
        </Cell>
        <Cell>
          <Data ss:Type="Number">12</Data>
          <NamedCell ss:Name="_FilterDatabase"/>
        </Cell>
        <Cell>
          <Data ss:Type="String">Constructs a new String by decoding the specified array</Data>
          <NamedCell ss:Name="_FilterDatabase"/>
        </Cell>
      </Row>
         ......
        </Table>
    </Worksheet>
      <x2:MapInfo x2:HideInactiveListBorder="false">
    <!-- Begin of x2:Schema -->
    <x2:Schema x2:ID="Schema1" x2:Namespace="">
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element nillable="true" name="DatabaseOnDemand">
          <xsd:complexType>
            <xsd:sequence minOccurs="0">
              <xsd:element minOccurs="0" nillable="true" name="QUERY" form="unqualified">
                <xsd:complexType>
                  <xsd:sequence minOccurs="0">
                    <xsd:element minOccurs="0" maxOccurs="unbounded" nillable="true" name="ROW" form="unqualified">
                      <xsd:complexType>
                        <xsd:sequence minOccurs="0">
                          <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="SRCSEQ" form="unqualified"></xsd:element>
                          <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="SRCDAT" form="unqualified"></xsd:element>
                          <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="SRCDTA" form="unqualified"></xsd:element>
                        </xsd:sequence>
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:schema>
    </x2:Schema>
    <!-- End of x2:Schema -->
</Workbook>

Related topics: