About XML files
XML (eXtensible Markup Language) is a markup language commonly used to transmit data between computer systems or applications.Analytics can import any well-formed XML document. A well-formed document is one that follows XML syntax rules.
XML file structure
XML files are structured
in a standard way and support any number of hierarchy levels. Hierarchy
levels are represented by nesting XML elements within other elements.
A data structure is a group of elements that can be mapped to an Analytics table.
Each data structure is identified with a table icon in
the Data Definition Wizard. When you define
an XML file, Analytics identifies any data structures in the file
that can be used to create an Analytics table.
Mapping XML data structures to Analytics tables
When you import a simple XML document with only one data structure, it can be mapped directly to an Analytics table. If you have a more complex XML file with several data structures, you may be able to combine the multiple data structures into a single Analytics table. If combining multiple data structures does not give the desired results, you can import each data structure into a separate Analytics table. You can then define relations between the resulting Analytics tables using the Relate Tables command.
File extensions
XML files typically use a standard file extension (.xml). In some cases, other file extensions are used, and the first line of the document identifies it as an XML file. If a non-standard file extension is used, you need to manually select the XML file format in the Data Definition Wizard.
XML elements and attributes
XML uses elements and attributes to identify the structure and content of data. Analytics can import both elements and attributes.
An element is a unit of XML data delimited by tags, and each XML element can enclose other elements. In the following example, the name element defines the value “John Smith”:
<name>John Smith</name>
An attribute provides additional information about an element. In the following example, the type attribute specifies that the account element represents a checking account:
<account type="checking">991110101</account>
In the Data Definition Wizard, attribute names are automatically preceded by the @ symbol to distinguish them from element names. For example, an attribute named “type” is displayed as “@type”.
XML sample
XML files usually include a mixture of elements and attributes, and at least one data structure. The following example shows the contents of a simple XML file that contains two client records:
<?xml version="1.0"?> <accounts> <client> <name>John Smith</name> <ID>JS004</ID> <account type="checking">991110101</account> <account type="savings">991110808</account> </client> <client> <name>Jane Smith</name> <ID>JS005</ID> <account type="checking">771110103</account> <account type="savings">771110303</account> </client> </accounts>