Corda.com
XML Data
Corda Server can import data from XML data format exported from a database. Most database systems are capable of exporting data to an XML format.
This functionality is supported in PopChart only (not OptiMap).
XML data files are different than Presentation Control XML. Whereas the former is a general 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.
Below is the basic syntax for an XML data file. The tags in italics represent names that are arbitrary. The tags in bold represent the names of categories or series. And, of course Data represents actual data. By default, most databases will export data in this format, so it may not be necessary for you to understand this syntax.
| Arrivals | Departures | Unused | Out of Commission | |
| Atlanta | 23 | 36 | 11 | 7 |
| Boston | 41 | 17 | 25 | 9 |
In XML, this data might appear as follows
<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>
If this data were being generated by a web application at http://www.yourserver.com/datagenerator?mon=may,
you could import this data to a graph in your Corda image using the Corda Embedder loadData() command, as shown below:
myPopChart.loadData("graph", "http://www.yourserver.com/datagenerator?mon=may");
Currently, Corda Server does not support importing standard XML data for an X-Y, Time Plot, or Stock graph. You should use PCXML instead.
To see example code that imports data from XML files, view your web environment below (note that tab-delimited files are imported in the exact same manner as CSV files):
| Web Environment | Application | Code Examples |
| ASP | PopChart | Dynamic Graphs |
| ASP.NET | PopChart | Dynamic Graphs |
| ColdFusion | PopChart | Dynamic Graphs |
| JSP | PopChart | Dynamic Graphs |
| JSP Tag Library | PopChart | Dynamic Graphs |
| Java Servlet | PopChart | Dynamic Graphs |
| JavaScript | PopChart | Dynamic Graphs |
| Perl | PopChart | Dynamic Graphs |
| PHP | PopChart | Dynamic Graphs |
For more information on importing XML data, refer to Chapter 5 of the PopChart and OptiMap Web Development manual.
