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 requestsXPath queries can be used to retrieve the data set required. This FAQ gives the full specifications of the Layer2 Data Provider for XML included in product.

 

​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

 

Connection String:

 

  • Url
    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.
  • Authentication
    Desired authentication method to connect to the XML data entity. Currently following methods are supported:
     
    Windows
    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.

    Anonymous
    No authentication is used. The data entity must be configured to allow anonymous access. This is the default authentication method.

 

 

Select Statement:

 

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.

  • Select
    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.
  • From
    A Xpath expression which gets relevant portion of xml.
    Sample: /bookstore/book expression gives all book nodes of the xml file shown below.

 

Layer2-Data-Provider-XML-SharePoint.png

Fig.: Sample XML data entity and query result for select statement above.

Layer2 Data Provider for XML: Sample Connection Strings

 

  • ​URL=http://www.w3schools.com/xml/cd_catalog.xml

Layer2 Data Provider for XML: Sample Select Statements

 

  • ​Select * from /CATALOG/CD[COUNTRY="USA"]
  • select title, title/@lang, price from /bookstore/book

Layer2 Data Provider for XML: Step-by-Step introduction

 

A step-by-step introduction how to setup the Layer2 Cloud Connector for SharePoint using the Layer2 Data Provider for XML is given here.

Layer2 Data Provider for XML: Use Cases & Known Issues 

 

  • Almost any LOB application today can export data files formatted as XML or expose XML directly via web requests. The provider can be used to connect to this type of data entity and replicate to native SharePoint lists, on-premise or in the Microsoft Cloud (SharePoint Online / Office 365).
  • Please note that the Layer2 Cloud Connector modifies only changed data in case of modified XML files or requests - not all items in list. Change notifications, alerts and workflows can be used as usual. The content of additional unmapped columns are kept while updating items in SharePoint.
  • While you generally can connect to RSS feeds using this provider, please note that there is a special Layer2 Data Provider for RSS as well. It has some more specific RSS related options and can be used to aggregate several different RSS sources using the same connection.
  • Please note that this provider is read-only. Writing to XML files or web services is not supported yet.

Ready to go next steps?

Layer2 leading solutions product regsitration icon: a grey square with a big orange pen symbol.

Register for free download.

Keep your 100+ systems in sync. Download and try the Layer2 Cloud Connector today.

Contact Us Icon for Layer2 leading solutions

Questions? Contact us.

We are here to help. Contact us and our consulting will be happy to answer your questions.