Skip to content

TSTool / Command / ReadTableFromXml


The ReadTableFromXML command reads a table from an XML file. An excerpt from an XML file is shown below. Note the WC:WaterAllocation content, which is data that can be read into a table as a “flat” representation.

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../styles/detail.xsl"?>
<WC:WaDE xmlns:WC="">
      <WC:ReportName>2014 CODWR WaDE REPORT</WC:ReportName>
          <WC:AllocationOwnerName>SWENSON AR WL FLD</WC:AllocationOwnerName>

The command requires an element to be specified to indicate rows, for example WC:WaterAllocation. All intervening elements that do not have child nodes will be added as columns. It is assumed that elements with child nodes are grouping elements and should not themselves be added (because they have no text content). The text content for nodes is added for the row’s data values. Currently all values are added as text. In the future an XSD file may be used to determine column types.

Command Editor

The following dialog is used to edit the command and illustrates the command syntax.


ReadTableFromXml Command Editor (see also the full-size image)

Command Syntax

The command syntax is as follows:


Command Parameters

Parameter             Description Default                  
The name of the file to read, as an absolute path or relative to the command file location. None – must be specified.
RowElement The XML file element that brackets a row’s data. None – must be specified.
If specified, the top (first) number of rows specified by the parameter will be returned. Return all data.
Identifier to assign to the table that is read, which allows the table data to be used with other commands. None – must be specified.


See the automated tests.


See Also