Connectors

XML File

The XML file provider is a read-only provider where you specify the data schema via XPath expressions.

Below is a sample XML file you can read with this provider there are a few things to note.

  • Each product is a child element of products

  • The id of the product is an xml attribute value of product.

    <products>
        <product id="1">
            <name>product1</name>
            <price>123.45</price>
        </product>
        <product id="2">
            <name>product2</name>
            <price>456.78</price>
        </product>
    </products>
    

The XPath to the product child nodes is either products/product or //product The XPath to the product id is @id and the XPath to name and price are name and price as they are elements of the product (current) node.

These XPath expressions then translate the XML document into a Table structure for Data Sync to use.

XPath documentation on MSDN https://msdn.microsoft.com/en-us/library/ms256471(v=vs.110).aspx

Connect to XML File Result

Connect to XML File

XmlDocumentUrl

The file path or Web Url to the XML file to load.

Windows Wildcards are supported in the filename i.e. *.xml.

XmlItemElementXPath

The XPath expression to the node item collection.

Namespaces

If you need to register XML Namespaces for your document you can add XML Namespaces and prefixes in this collection.

Columns

Add to the Columns collection specifying the DataType, Name and the XPath Expression. XML XPath expressions are case-sensitive.

ID Column Name Column Price Column

SearchInFolders

When using Wildcard filenames this specifies whether the search will include subfolders.

__SourceFileName

This is a special column that is injected into your schema and will return the filename of the XML document. This is especially useful when using wildcard filenames.