XML to Table - Display XML data in a grid
-
General
Any (Data-Oriented) XML file can be regarded as a small database containing one
or more data tables. It can be useful to view the data in a grid, where it can
be manipulated interactively.
The Xml2Table application can take any data-oriented, well-formed XML file,
located either on the local disk or on the Internet, and organize it in a grid,
where the (virtual) tables can be viewed separately, the data can be paged and
sorted and individual records can be extracted.
The table can be exported to Excel and saved locally as an Excel file.
Limitations:
-
The XML file should be data-oriented (having a table organization) and
well-formed.
-
If a resource file (DTD, XSL) is referenced within the XML file, it should be
accessible.
-
XML files with multiple nodes having the same name cannot be handled, even if
the file is well formed. It is required that all nodes (in different sections)
will have unique names. This limitation is related to the fact that a dataset
(on which the application is based) is a relational object (allowing relations
between multiple nodes), while an xml file is a hierarchical object (each node
relates only to its parent).
-
Internal relations between the tables are not supported. Each table exists as a
separate entity.
-
Sorting is string-based for all fields (including numeral fields).
-
Instructions
1. Enter the XML Url or path.
Use one of the following:
-
1. Load a file from the Internet:
Type the Url in the Url/File text box. The Url string should be of the
form:
http://domain/directory/filename.xml
-
2. Load a local file.
Use one of the following methods:
-
Type the full file path (e.g. c:\myfolder\myfile.xml)
-
Click the Browse button and select the XML file.
-
3. Load a sample:
If you just want to try the application, you can load one of the sample files:
-
Click the Samples
button;
-
A list box will be displayed.
-
Select one of the XML files from the list box.
-
The XML files represent tables from the Microsoft's sample NorthWind database.
2. Select the required page size.
The data will be displayed in pages, and moving from page to page is done by
clicking the page numbers shown below the table. Selecting a small page size
will result in many pages, but each will be viewed in whole without scrolling.
Selecting a large page size will show a large amount of data on the same page,
but will require scrolling.
3. Click the XML>Table button
The application will attempt to load the XML file and analyze it.
In case of any problem a corresponding error message will be displayed.
Otherwise, the Tables list box will become enabled, and the application will
proceed with one of the following:
-
The XML file contains a single table:
The table will be displayed in the grid, according to the selected page size.
-
The XML file contains multiple tables:
-
A 'Completed' message will be displayed, prompting for table selection.
-
The Tables list box will be populated with the names of the tables
-
In case of loading one of the sample files, this stage will be executed
automatically, and the table will be displayed immediately.
4. Select a table from the Tables list box (case of multiple tables)
If the XML file contains more than one table, any of these tables can be
selected from the Tables list box.
-
The selected table will be displayed in the grid, according to the selected
page size.
-
The fields table will be populated with the field names of the selected table.
5. Manipulate Data: Page, sort, resize, view, export to Excel
The following actions are available:
-
Paging:
The data can be browsed by moving back and forth between the pages, using the page
numbers shown below the table.
-
Sorting:
-
Clicking on any column header
will sort the table according to the corresponding field.
-
Clicking again on the same header will sort in reverse order.
-
Sorting can also be done by selecting a field name from the fields table.
-
All fields are sorted as if they are text fields.
-
Changing Page Size:
Selecting any of the available values from the Page Size list box will
update the table according to the new page size.
-
Viewing record data in a separate window
Clicking the Show link at the grid's left column opens a popup window
displaying all the fields of the selected record. The data can then be copied
and pasted as needed.
-
Exporting the table to Excel
-
Clicking the Table>Excel
button displays the current table in Excel.
-
The Excel page can be manipulated online
-
The Excel page can also be saved to disk with an xls
extension, and loaded to Excel by double-clicking.
-
It is recommended to set page size to All
before exporting to Excel (only the currently displayed table is converted to
Excel).
-
If, when trying to sort the Excel table, you get a message about merged cells
problem, do the following:
-
Highlight the whole range.
-
Go to Format/Cells
in the top menu.
-
Click on the Alignment
tab.
-
If the Merge Cells box is checked, click on it until the check mark
disappears.
6. View another table
If there are multiple tables in the file, you can select another table from the
Tables list, and click theXML>Table burron. The screen will be updated
accordingly (see #3 above).
-
Sample
XML Url's
The following Urls point to XML files representing several tables of the
NorthWind sample database.
In order to use the samples, do the following:
-
Mark (select) the required Url in the list below.
-
Copy (Ctrl-C) the string.
-
Paste (Ctrl-V) the string into the Url text box.
-
Click the XML>Table button.
-
NorthWind database tables in XML files:
-
Products:
http://www.aridolan.com/xmlfiles/Products.xml
-
Suppliers:
http://www.aridolan.com/xmlfiles/Suppliers.xml
-
Employees:
http://www.aridolan.com/xmlfiles/Employees.xml
-
Customers:
http://www.aridolan.com/xmlfiles/Customers.xml
-
Shippers:
http://www.aridolan.com/xmlfiles/Shippers.xml
-
Orders:
http://www.aridolan.com/xmlfiles/Orders.xml
-
A multi-table example:
Blast Example (Bioinformatics):
http://www.aridolan.com/xmlfiles/Blast_Example.xml
Back to Top