xcopy [--respective|:r] [--preserve-order|:p] expression location expression




xcopy is similar to copy, but copies all nodes in the first node-list expression to all destinations determined by the location directive relative to the second node-list expression. See copy for detailed description of xcopy arguments.

If --respective|:r option is used, then the target node-list expression is evaluated in the context of the source node being copied.

The --preserve-order|:p option can be used to ensure that the copied nodes are in the same relative order as the corresponding source nodes. Otherwise, if location is after or prepend, the relative order of the copied nodes will be reversed, because source nodes are placed to the target location one by one.

Example 57. Copy all middle-earth creatures within the document $a into every world of the document $b.

xsh> xcopy $a/middle-earth/creature into $b//world

See Also

copy, move, xmove, insert, xinsert