Layer2 Data Provider for XML: Specifications for Layer2 Cloud Connector
The Layer2 Cloud Connector for SharePoint can
be used to connect
almost any external data sources to native SharePoint lists and libraries, even
external XML data, file-based or based on web
requests. XPath queries can be
used to retrieve the data set required. This FAQ gives the full specifications of the Layer2 Data Provider for XML included
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.
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
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
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
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, title/@lang, 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
Sample: /bookstore/book expression gives all book nodes of the xml file
Fig.: Sample XML data entity and
query result for select statement above.