Skip to content

$XmlRepository

$XmlRepository provides access to the XML repository.

You can query the XML repository using the $XmlRepository.Query or $XmlRepository.QueryXml methods.

For data manipulation, you can use the $XmlRepository.Save and $XmlRepository.Delete methods.

1
const $XmlRepository;

Examples

Save a record and query it later

1
2
3
4
5
6
var customer = $Xml.SelectSingle('Customer');
$XmlRepository.Save('Customers/' + customer.Evaluate('Id'), customer);

var names = $XmlRepository.Query('//Customer[Id = $id]/Name/text()', {
    id : customer.Evaluate('Id')
});

Capabilities

Persistence

Querying

  • $XmlRepository.Query: Executes an XQuery against the repository and returns the results as an array of strings.
  • $XmlRepository.QueryXml: Executes an XQuery against the repository and returns the results as an array of XML nodes.