Versions Compared

Key

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

...

Code Block
languagejs
$Xml.Save('', 'Person/' + $Xml.Evaluate('Id'));

Example

Saving child node 'Addresses' to repository.

Code Block
languagejs
$Xml.Save('Person/Addresses');

Example

Saving basic transformed result to repository.ts

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

Example

Saving advanced transformed result to repository.

Code Block
languagejs
$Xml.Save('copy $input := .                                 ' +
   '  modify(                                        ' +
   '    replace value of node $input/Name with 'X',  ' +
   '    insert node <Age>1</Age> into $input         ' +
   '  )                                              ' +
   '  return $input                                  ');

Example

Saving with conditional processing

Code Block
languagejs
this.Save('  for $risk in //Risk                                                        ' +
    '  where $risk/Action = 'C'                                                   ' +
    '  return                                                                     ' +
    '  copy $input := $risk                                                       ' +
    '    modify (                                                                 ' +
    '      delete node $input/Tasks,                                              ' +
    '      delete nodes $input/Comments[State],                                   ' +
    '      insert node <Group>{ $risk/ancestor::Group/Name }</Group> into $input  ' +
    '    )                                                                        ' +
    '    return $input                                                            ');