XML Data Files

Corda Server™ can load XML data files, which can be exported by many database and spreadsheet applications. XML files only support data, and not formatting options or data annotations.

Important: Only graphs support XML data files, not maps.

This section is divided into the following topics:

Formatting Data

Most newer database systems can export data in an XML format. Corda Server can import most XML files exported by these databases.

It is important to remember that XML data files are not equivalent to ITXML data files. Whereas the former is a general and loose format for describing data, the latter is a small subset of a rigid and robust XML document type created specifically for defining a Corda image. For more information about ITXML, see ITXML.

The example below shows the basic syntax for an XML data file. The italics represent names that are arbitrary. The orange font represents names of graph categories or series.

Note: Most databases export data in this format, which works with Corda Server without modification.

XML Data Syntax

<DataSetName >

<SeriesProperty >

<SeriesNameTag >Series Name </SeriesNameTag >

<CategoryName1 >Data </CategoryName1 >

<CategoryName2 >Data </CategoryName2 >

...

</SeriesProperty >

<SeriesProperty >

...

</SeriesProperty >

...

</DataSetName >

The code sample below shows a basic XML data file, which is available in <document_root>\examples\data\data1.xml.

Note: The XML tag names are irrelevant as long as they are consistent. If possible, use tag names that are meaningful to the data being represented.

Example Data in XML Format

<CarStatus>

<CityInventory>

<City>Atlanta</City>

<Arrivals>23</Arrivals>

<Departures>36</Departures>

<Unused>11</Unused>

<Out_of_Commission>7</Out_of_Commission>

</CityInventory>

<CityInventory>

<City>Boston</City>

<Arrivals>41</Arrivals>

<Departures>17</Departures>

<Unused>25</Unused>

<Out_of_Commission>9</Out_of_Commission>

</CityInventory>

</CarStatus>

Corda Server requires the following XML formatting conventions:

Currently, Corda Server does not support importing standard XML data for an X-Y, Time Plot, or Stock graphs. Use ITXML instead.

Importing with Corda Embedder

Important: In order for Corda Server to load any kind of file or data source, it must be given permission to read data from the specified path or domain. For more information, see Setting Path Permissions in the Corda 7 Install and Administration manual.

To import XML data files into graphs, use the loadData() method. The loadData() method accepts two parameters for XML data:

Important: ASP/VBScript requires five parameters. The last three parameters are empty strings (““).

For example, to load a data file named <document_root>\data\prices.dat, use the following Corda Embedder method call:

myImage.loadData("graph","data/prices.dat");

Similarly, to load data from a Web application at http://Webapp.mycompany.com/getdata, use the following Corda Embedder method call:

myImage.loadData("graph","http://Webapp.mycompany.com/getdata?year=2002");

Note: The code above assumes a Corda Embedder object named myImage.