Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

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

Example

Loading a simple result to current node

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

Example

Loading basic transformed result to current node

$Xml.Load('for $c in //Person                         ' +
   'where $c/Surname                                  ' +
   'return                                            ' +
   '  <Person>                                        ' +
   '    <Name>{ $c/Name }</Name>                      ' +
   '  <Person>                                        ');
  • No labels