Developing Apama Applications > Building Dashboards > Using XML Data > XML data format > Tabular data elements
Tabular data elements
Tabular data elements contain multiple columns and rows of data. The value for each field can be a string, integer, double, or boolean. Tabular data elements are useful for data sets containing multiple item instances. Tabular data can be used to populate Table, Trend Chart, and other dashboard objects.
Tabular elements are defined in a table tag that includes a set of tags that describe the data in the table and tags for each row of data values. A tabular element is defined as follows:
  <table key="production_table">
    <tc name="column1"
      type="string | double | int | boolean"
      index="true | false"/>
    <tc name="column2"
      type="string | double | int | boolean"
      index="true | false"/>
    <tr name="ID0”>
      <td>column1_value</td>
      <td>column2_value</td>
    </tr>
    <tr name="ID1">
      <td>column1_value</td>
      <td>column2_value</td>
    </tr>
  </table>
The key attribute on the table tag specifies the name of the data table. This name will be used when attaching object properties to the data element.
The tc tag defines a column in the table. For each column, you must specify a name, type, and whether or not the column is to be used as index. Subsequent row definitions must contain values for each column where the type of the value matches the type defined for the column. The index field is reserved for future use.
The tr tag defines a single row of data. Each row must contain a td tag for each column in the table. The td tags define the value for a column for a single row.
Following is an example XML data file containing a tabular data element named production_table:
<?xml version="1.0"?>
<dataset xmlns="www.sl.com" version="1.0">
<table key="production_table">
  <tc name="Plant"
     type="string"
     index="true"/>
  <tc name="Units in Production"
     type="int"
     index="false"/>
  <tc name="Units Completed"
     type="int"
     index="false"/>
  <tc name="Status"
     type="string"
     index="false"/>
  <tc name="On Schedule"
     type="boolean"
     index="false"/>
  <tr name="PID 0">
    <td>San Francisco</td>
    <td>87</td>
    <td>70</td>
    <td>online</td>
    <td>true</td>
  </tr>
  <tr name="PID 1">
    <td>San Jose</td>
    <td>75</td>
    <td>63</td>
    <td>online</td>
    <td>false</td>
  </tr>
</table>
</dataset>
Here, the table is defined as containing four columns; Plant, Units in Production, Units Completed, and On Schedule. There are two rows in the table; one each for San Francisco and San Jose.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.