...
Array<string> $XmlRepository.Query(xquery: string)
...
string
...
Array<string> $XmlRepository.Query(xquery: string, parameters: object)
Arguments
...
Specifies the query to perform on the database. The syntax of the query is quite detailed. More information can be found on xquery standard page.
object parameters
Specifies the binding parameters on xquery string.
...
The examples below shows how to query the domain database.
The syntax of the query is quite detailed. More information can be found on xquery standard page. ,
Example
Find all customers
...
Code Block | ||
---|---|---|
| ||
$XmlRepository.Query('let $nodeValue := fn:parse-xml-fragment($nodeValue)' +
'for $record in Relation[Id=$id]/RepHistory/RepHistoryRecord[InstanceId=$instanceId] return ' +
'(delete node $record)', {
id : relationId,
instanceId : $Xml.Evaluate('SelectedHistory/Id'),
nodeValue : $Xml.SelectSingle('.').InnerXml()
}); |
Example
Querying process database
Code Block | ||
---|---|---|
| ||
var results = $XmlRepository.Query('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', {
id : $Xml.Evaluate('CustomerId')
});
$Xml.InnerXml( 'Customers', results[0].Evaluate('Id') ); |
Example
Code Block | ||
---|---|---|
| ||
Querying process database var results = $XmlRepository.Query('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results[0].Evaluate('Id') ); |