Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Loads xml content to current node from $XmlRepository

void myXml.Load(xquery: string)

Loads xml content to current node from $XmlRepository

void myXml.Load(xquery: string, parameters: object)

Loads xml content to current node from $XmlRepository

void myXml.Load(xquery: string, parameters: object, collection: string)

Arguments

string xquery
XQuery to perform.
object parameters
If xquery has binding parameters this argument specifies to a dictionary of parameter values.
string collection
name

Remarks

This method loads only matched elements with node xml scheme. Non-matching elements are ignored.

Registered namespace prefixes are implicitly declared while performing xquery.

If the resulting query returns the same node name as the current node name; the current node inner xml is replaced with the result, otherwise resulting nodes are processed as child nodes to current node.

For more xquery details please refer to XQuery standard and XQuery Update standard

Example

Save & Load

Code Block
languagejs
$Xml.Save('','Settings'); // save current node
$Xml.Load('Settings/*'); // load current node contents

Example

Loading a simple result to current node

Code Block
languagejs
$Xml.Load('Person[Id=1]');

Example

Loading basic transformed result to current node

Code Block
languagejs
$Xml.Load('for $c in //Person                         ' +
   'where $c/Surname                                  ' +
   'return                                            ' +
   '  <Person>                                        ' +
   '    <Name>{ $c/Name }</Name>                      ' +
   '  <Person>                                        ');