Copy¶
Copies the current XML node and all its child nodes from the source XPath to the target XPath or target navigator.
1 | |
Parameters¶
string sourceXPath
XPath of the node to copy. Use "." to specify the current node.
( string | Xml ) target
Target XPath or Xml instance to copy to.
Remarks¶
This method attempts to determine the type of the node being copied from the XML schema. If the relevant schema is found, the copy operation is performed based on the XML schema definitions. Otherwise, it copies only nodes with matching names. Copying based on XML schema definitions automatically resolves collection items and creates new nodes.
Both the source and the target node must exist; an error is thrown when either XPath selects nothing. When several nodes match, the first one is used.
Examples¶
Copy a simple value¶
1 | |
Copy a complex node with its child nodes¶
1 2 | |
Copy data parsed from a service response into the pool data¶
1 2 | |