logo

XApperator

lightweight, manouverable and quickly deployed

Data Importing and Flattening

Data files to be managed by XApperator need to be in a flat file structure which means there needs to be a single parent node for each file with one or more child records which each contain a series of one or more elements which can themselves contain only text.

XML attributes cannot be used in the data files at present and deeply nested elements will also not be accessable. This is no problem at all if you are starting with a green-fields development creating new data files from scratch.

If you have existing XML files however that you need to import into XApperator you will first have to "flatten" them out. Following is an example flattening exercise, the source files for which you'll find in the /tools/ folder of the distribution.

Imagine you have the following XML file which contains contact information for department members at your company where the staff are grouped under dept tags...

The above data structure requires a number of changes. To create a usable XML file containing just the members from the 'ITS' department we will need to eliminate the parent phonebook element, will have to drop the dept @name attribute, the member user attribute will need to be coverted to a standalone element as will the email @display element.

Following then is a sample XML file flattened out and ready to be used within XApperator...

And following is a sample XSLT file that might be used to transform the source XML into the desired flattened target XML...

As mentioned above, all three of these example files are included in the /tools/ directory of the XApp distribution.


Authored using: XApperator