XML Data Source¶
This data source executes an XPath expression on the current data model and returns the result as a list of values.
The XPath expression to be evaluated is defined within the SourceXPath
element, while the ItemXPath
element designates the path to the items within the XML data that will be returned as the result of the query.
The SourceXPath
property supports the data templates format, enabling the data source to adapt to a varying data model.
Example¶
In summary, this data source will locate the Options
element within the current data model based on the SourceXPath
. It will then treat each Option
element within that Options
element as an individual item and use the Name
and Id
elements within these Option
elements to generate the text and value for the list.
1 2 3 4 5 6 |
|
In this configuration:
TextFormat
is set to{{Name}}
, indicating that theName
element within each item will be used for display text.ValueFormat
is set to{{Id}}
, specifying that theId
element within each item will be used as the underlying value.Enabled
is set toTrue
, activating the data source.Mappings
is empty, meaning no additional mappings are specified.ItemXPath
is set to<![CDATA[Option]]>
, specifying that theOption
elements within the XML will be treated as individual items in the result.Columns
is empty, meaning no specific columns are being retrieved other than what is defined in theItemXPath
andTextFormat
,ValueFormat
.SourceXPath
is set to<![CDATA[/*/Options]]>
, which indicates that the XPath expression/*/Options
will be used to locate the XML data source within the current data model. This expression selects theOptions
element that is a child of the root element (*
).