How to import data from an external XML file

The latest Tabulizer releases can read an external XML file and display it like a regular HTML table, using a data source of type "XML".

Ok, let's see the settings for a sample data source of type xml:

The File path/URL parameter points to the URL of the XML file. The other parameter that needs some explanation is the XML Node to TD map. Use this parameter to specify which nodes of the input XML file will be read and the header row/label that corresponds to them. For instance, in this sample data source the input XML file contains the following data:

<CATALOG>
    <CD>
        <TITLE>Empire Burlesque</TITLE>
        <ARTIST>Bob Dylan</ARTIST>
        <COUNTRY>USA</COUNTRY>
        <COMPANY>Columbia</COMPANY>
        <PRICE>10.90</PRICE>
        <YEAR>1985</YEAR>
    </CD>
    <CD>
        <TITLE>Hide your heart</TITLE>
        <ARTIST>Bonnie Tyler</ARTIST>
        <COUNTRY>UK</COUNTRY>
        <COMPANY>CBS Records</COMPANY>
        <PRICE>9.90</PRICE>
        <YEAR>1988</YEAR>
    </CD>
    ...
</CATALOG>

In our example, the XML Node to TD map parameter has the following value:

TITLE=title^
ARTIST=Artist^
COUNTRY=Country^
COMPANY=Label

In other words, the following syntax applies:

NODE ID 1=Label for NODE ID 1^
NODE ID 2=Label for NODE ID 2^
NODE ID 3=Label for NODE ID 3^
NODE ID 4=Label for NODE ID 4

By not specifying a map for the tags PRICE and YEAR essentially we excluded them and the resulting table looks like this:

title Artist Country Label
Empire Burlesque Bob Dylan USA Columbia
Hide your heart Bonnie Tyler UK CBS Records
Tip: if you want to remove the top header row, simply add a new rule to remove the row with range = 1