Sync¶
Synchronizes the nodes at the specified XPath with the input nodes, and returns an array of the synchronized nodes.
1 |
|
Synchronizes the nodes at the specified XPath with the input nodes, and returns an array of the synchronized nodes.
1 |
|
Parameters¶
string xpath
XPath of the node to synchronize.
Array<Xml> input
Array of Xml nodes to synchronize with.
(node: Xml) => string hash
Hash function to compare nodes. If omitted, the node instance is used for comparison.
Array<Xml> removedNodes
Optional array to add removed nodes to.
Returns¶
An array of synchronized Xml nodes. An array of synchronized Xml nodes.
Remarks¶
Synchronization is based on the input nodes and performs the following actions at the specified XPath:
- Node comparison is performed using the specified hash function, which returns a unique identifier for each node. If no hash function is specified, the node instance is used for comparison.
- Nodes that exist in the input array but not in the current node are automatically created in the current node.
- Existing nodes in both the input array and the current node are copied.
- Nodes that exist in the current node but not in the input array are removed from the current node. Optionally, a list of removed nodes can be added to the removedNodes
parameter.
Synchronizing the contents of "Source" and "Target" nodes:¶
1 2 3 4 |
|
Performing an XQuery and merging the results with the current nodes:¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Synchronization is based on the input nodes and performs the following actions at the specified XPath:
- Node comparison is performed using the specified hash function, which returns a unique identifier for each node. If no hash function is specified, the node instance is used for comparison.
- Nodes that exist in the input array but not in the current node are automatically created in the current node.
- Existing nodes in both the input array and the current node are copied.
- Nodes that exist in the current node but not in the input array are removed from the current node. Optionally, a list of removed nodes can be added to the removedNodes
parameter.
Synchronize "Source" and "Target" node contents¶
1 2 3 4 |
|
Performs xquery and merges results with current nodes¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|