XML file format

You can upload data to 1010data using an XML file, specifying the table and column attributes via XML elements.

Even though you can upload an XML file in the user interface by performing a Simple Upload, 1010data recommends using the addtab transaction in the 1010data API instead. For more information, see addtab (Load a large table) in the 1010data API Reference Manual.
Note: The XML file format is not supported when performing an Advanced Upload in the user interface.

An XML file must have an .xml file extension and the following format (spaces and indentations are optional):

<table>
  <title>table title</title>
  <sdesc>short description</sdesc>
  <ldesc>long description</ldesc>
  <link>link title</link>
  <maxdown>download limit</maxdown>
  <cols>
    <th name="name of first column"
        type="data type of first column"
        format="data format for first column">
        heading for first column
    </th>
    <th name="name of second column"
        type="data type of second column"
        format="data format for second column">
        heading for second column
    </th>

  ...

    <th name="name of last column"
        type="data type of last column"
        format="data format for last column">
        heading for last column
    </th>
  </cols>
  <data>
    <tr>
      <td> value for first row of first column </td>
      <td> value for first row of second column </td>

  ...

      <td> value for first row of last column </td>
    </tr>
    <tr>
      <td> value for second row of first column </td>
      <td> value for second row of second column </td>

  ...

      <td> value for second row of last column </td>
    </tr>

  ...

    <tr>
      <td> value for last row of first column </td>
      <td> value for last row of second column </td>

  ...

      <td> value for last row of last column </td>
    </tr>
  </data>
</table>

Table and Column Attributes

<title> The title of the table
<link> Table name for linking

If you plan to link this table into other tables, specify a short (one or two word) title here. When the table is linked, this title will appear in its column headings. This will help distinguish which columns come from which tables. To specify a multi-line header, use the backtick (`) special character to separate the lines. (On most American keyboards the ` character is immediately to the left of 1.)

<maxdown> The maximum number of data items (rows x columns) that can be downloaded at a time
type Column data types (one for each column)
An attribute of the <cols> element, type specifies the type of data in the column; valid values are:
  • i (integer)
  • j (big integer)
  • f (decimal)
  • a (text)

For more information about data types, see Data types

format Column display formats (one for each column) (optional)

An attribute of the <cols> element, format describes how the column's data should be displayed. See Display formats.

Note: <title>, <sdesc>, <ldesc>, <link>, and <maxdown> are optional. <th> may be used in place of <td> and vice versa.

See Table Tree for detailed information about the structure of the XML file.

Example

Here's an example of an XML file:

<table>
  <title>Sales Item Detail
  </title>
  <cols>
    <th name="transid" type="i">Transaction ID
    </th>
    <th name="account" type="i">Account
    </th>
    <th name="store" type="i">Store
    </th>
    <th name="date" type="i" format="type:date">Date
    </th>
    <th name="sku" type="a">Item SKU
    </th>
    <th name="units" type="i">Units
    </th>
    <th name="sales" type="f">Sales
    </th>
    <th name="cost" type="f">Cost
    </th>
  </cols>
  <data>
    <tr>
      <td>531
      </td>
      <td>957
      </td>
      <td>1
      </td>
      <td>20120515
      </td>
      <td>366
      </td>
      <td>-1
      </td>
      <td>-5
      </td>
      <td>-1.84
      </td>
    </tr>
    <tr>
      <td>535
      </td>
      <td>709
      </td>
      <td>2
      </td>
      <td>20120515
      </td>
      <td>CB7
      </td>
      <td>1
      </td>
      <td>1.65
      </td>
      <td>1.1
      </td>
    </tr>
    <tr>
      <td>535
      </td>
      <td>709
      </td>
      <td>2
      </td>
      <td>20120515
      </td>
      <td>96A
      </td>
      <td>1
      </td>
      <td>1.1
      </td>
      <td>1
      </td>
    </tr>
    <tr>
      <td>538
      </td>
      <td>668
      </td>
      <td>1
      </td>
      <td>20120518
      </td>
      <td>969
      </td>
      <td>1
      </td>
      <td>1.1
      </td>
      <td>1
      </td>
    </tr>
    <tr>
      <td>538
      </td>
      <td>668
      </td>
      <td>1
      </td>
      <td>20120518
      </td>
      <td>3B7
      </td>
      <td>1
      </td>
      <td>1.1
      </td>
      <td>0.56
      </td>
    </tr>
    <tr>
      <td>539
      </td>
      <td>25
      </td>
      <td>2
      </td>
      <td>20120619
      </td>
      <td>65B
      </td>
      <td>1
      </td>
      <td>5
      </td>
      <td>3.35
      </td>
    </tr>
  </data>
</table>