XML Query Data Source¶
This data source executes an XQuery expression on an XML database and returns the result as a list of values.
Due to the flexibility of XQuery, this data source can be utilized to query and transform XML data in a multitude of ways.
Query parameters can be specified using the Parameter elements, and the query itself is defined within the Query element.
The ItemXPath element designates the path to the items within the XML data that will be returned as the result of the query.
Example¶
The following example demonstrates a straightforward query that retrieves contacts from an XML database. The query filters the contacts based on a search name and relation type and returns the contacts sorted by display name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
In this configuration:
TextFormatis set to{{DisplayName}}, indicating that theDisplayNameelement within the XML result will be used for display text.ValueFormatis set to{{Id}}, specifying that theIdelement will be used as the underlying value.Enabledis set toTrue, activating the data source.Mappingsis empty, meaning no additional mappings are specified.ItemXPathis set to<![CDATA[Contract]]>, indicating the path to the elements that will be processed as items.- The
Parameterselement defines two parameters:filter, which is mapped to theFilter/SearchNameelement in the data model.typeId, which is mapped to theFilter/RelationType/Idelement in the data model.
- The
Queryelement contains the XQuery expression which:- Iterates over all
Contactelements. - Filters contacts based on the
filterandtypeIdparameters, using a case-insensitive search on theSearchNameelement. - Orders the results by the
DisplayNameelement. - Returns each matching
Contactelement.
- Iterates over all