Chapter 7. XML DataSource

Table of Contents

Overview
XML DataSource Wizard
Use of Merge
Subtree Optimization
HTML
EDIFACT
Search in XPath Builder
Working with XML DataSources

Overview

In Elixir Data Designer data in XML files can be accessed by adding an XML DataSource.

The basic requirements to access the XML document is a well formed XML document and a XPath that is used to query the XML document, locate and retrieve data.

The text data sources with fields having different date, time and timestamp formats can be added.

Furthermore, the URL of the files can be specified in the form of an XQuery to retrieve data from XML databases like Software AG Tamino or EAI solutions with XML output like BEA Liquid Data.

XPath

XPath is a W3C specification for retrieving data from an XML file. It is a query language for XML. Elixir Data Designer provides an XPath Builder. The features are given below:

  • It provides a tree view structure of the XML source.

  • Specifies the target "records" with Root XPath.

  • Specifies columns to be added by dragging and dropping from the XML tree.

  • The column name or the XPath of the columns can be changed.

  • It provides full support for XPath.

The XML tree structure appears as shown in Figure 7.1, “An XML Tree”.

Figure 7.1. An XML Tree

An XML Tree

Here A is the main element having sub-element B which in turn has sub-element C. There are two root paths as given below

  • Absolute Path: The absolute path starts from the root of the document.

  • Relative Path: The relative path starts from each of the currently defined node(s).

Some basic syntax of the XPath are given below:

  • /A/B/C - All the C children of B which are children of the root node A.

  • /C - The C root node.

  • //C- All C nodes in the document. The Name of the file is entered in the Name column. The Description of the file is specified in the Description text box.

  • id("S_24") - The node with ID value "S-24".

An absolute XPath starts from the root of the document tree. As shown above an XPath can be absolute or relative.

Note

For more information on XPath refer to the website http://www.w3schools.com/xpath/xpath_functions.asp