Perform a Deep Copy of Elements with a copy-of Constructor

You can perform a deep copy of all child elements of a source parent node to the child elements of a target parent node in the mapper. This eliminates the need to individually map each source child element to each target child element.

  1. Click XSLT.
  2. In the upper right corner, click Toggle functions Mapper functions icon.
  3. Expand XSL Constructors, then Output.
  4. Drag copy-of to the target parent element (for this example, execute).

    The Sources, Mapping canvas, and Target sections are shown. The XSL Constructors section is expanded to show the copy-of constructor being selected and dragged to the execute element.

  5. Drag the parent element request-wrapper in the Sources section to the copy-of constructor in the Target section. This automatically maps all child elements under the source parent element request-wrapper to the child elements under the target parent element request-wrapper.

    The Sources, Mapping canvas, and Target sections are shown. The source request-wrapper is mapped to the target copy-of element.

  6. Click Code Mapper code iconto view the mappings in code view.

    The code view shows the request-wrapper with the testOne and testTwo elements.

  7. If required, you can add additional copy-of constructors to the target tree.

    The XSL Constructors section is expanded to show a second copy-of constructor being selected and dragged to the execute element.

  8. Drag the parent element HTTPHeaders in the Sources section to the copy-of constructor in the Target section. This automatically maps all child elements under the source parent element HTTPHeaders to the child elements under the target parent element request-wrapper.

    The Sources, Mapping canvas, and Target sections are shown. The source request-wrapper is mapped to the target copy-of element and the source HTTPHeaders is mapped to a second target copy-of element.

  9. Click Code Mapper code icon again to view the additional mappings in code view.