The Layer2 Data Provider for XML can retrieve data from xml sources on file systems or via http web requests using a connection string and a select statement.
Path to the xml file which can be Url or local file path Aliases are : Url, DataSource, Data source, Web, Host, Server, Address. This field is mandatory.
Samples are C:\mydir\myfile.xml or http://myserver/myquery.xml
- UserName / Password
Optional credentials to connect to the XML data entity using a specific authentication method. Aliases are User, UserId, User Id and Password, pass, pwd.
Desired authentication method to connect to the XML data entity. Currently following methods are supported:
This authentication method is using a Windows Active Directory account to authenticate against a serverr. If this method is used, it is necessary to define both user and password, whereas the user is specified in the format DOMAIN\username.
No authentication is used. The data entity must be configured to allow anonymous access. This is the default authentication method.
The data is fetched using a select query statement which actually can contain XPath expressions.
The expression which came after the “select” could be ‘*’ or specific field names (actually XPath expressions as well) that tells which fields should appeare in the result set. Using ‘*’ will load all xml content into the DataSet.
One disadvantage of this approach is that nodes with attribute(s) are taken into separate table(s) by dataset and a relation is established between main table and this child table. Since first table is returned by the provider as result, child tables are lost.
Using field names or field paths directly gives more control. The Where clause is considered to be part of the XPath expression (see sample below).
A select statement for the Layer2 Data Provider for XML contains the following standard fragments.
Can be *, field names or Xpath expressions that point to attributes, e.g.:
select title, [email protected], price from /bookstore/book will give title, price nodes and lang attributes of the title of book node as a datatable as shown below.
A Xpath expression which gets relevant portion of xml.
Sample: /bookstore/book expression gives all book nodes of the xml file shown below.
Fig.: Sample XML data entity and query result for select statement above.