Skip to content

XmlNode.Load

Overview

void XmlNode.Load ( xquery, [ parameters ], [ collection ] )
Loads xml content to current node from $XmlRepository

Arguments

String xquery

XQuery to perform.

Object parameters

If xquery has binding parameters this argument specifies to a dictionary of parameter values.

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

Examples

Loading a simple result to current node

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

Loading basic transformed result to current node

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

See Also