Overview
Performs an xquery on repository and returns the results as xml node array. Queries the domain database by default if not specified. See XML Database page for further information about domain and process databases.Array<XmlNode> $XmlRepository.QueryXml(xquery: string)
Array<XmlNode> $XmlRepository.QueryXml(xquery: string, parameters: object)
Arguments
string xquery
Specifies the query to perform on the database. The syntax of the query is quite detailed. More information can be found on,standard, page.
string xquery
Specifies the query to perform on the database. The syntax of the query is quite detailed. More information can be found ,standard, page.
object parameters
Specifies the binding parameters on xquery string.
Remarks
The examples below shows how to query the domain database. To see how to query a process database check the latter examples.
Example
Find all customersvar results = $XmlRepository.Query('//Customer'); $Xml.InnerXml( 'Customer', results.join() );
Example
Find customer by idvar results = $XmlRepository.Query('//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results.join() );
Example
Querying process databasevar results = $XmlRepository.QueryXml('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results[0].Evaluate('Id') );
Remarks
The examples below shows how to query the domain database. To see how to query a process database check the latter examples.
Example
Find all customersvar results = $XmlRepository.Query('//Customer'); $Xml.InnerXml( 'Customer', results.join() );
Example
Find customer by idvar results = $XmlRepository.Query('//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results.join() );
Example
Querying process databasevar results = $XmlRepository.QueryXml('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results[0].Evaluate('Id') );
Examples
Find all customersvar results = $XmlRepository.Query('//Customer'); $Xml.InnerXml( 'Customer', results.join() );
var results = $XmlRepository.Query('//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results.join() );
var results = $XmlRepository.QueryXml('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', { id : $Xml.Evaluate('CustomerId') }); $Xml.InnerXml( 'Customers', results[0].Evaluate('Id') );