copy
Copy Resource Accessor API
Index > Books > Declarative Development Guide > Reference Library > Accessor Listing > copy

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:ext:dpml

Definition

Active URI Base

active:copy

Format

<instr>
  <type>copy</type>
  <operand>foo.xml</operand>
  <target>bar.xml</target>
</instr>

Syntax

ArgumentRulesDescription
typeMandatory copy
operandMandatory Fragment OKthe resource to be replicated
targetMandatory Fragment OKthe target resource

The copy accessor assigns the value of one resource to another. If the resource that is being assigned to supports sinking of data then the data will be sunk. This primative operatorion is built into the DPML language.

Common uses include copying a static or transient resource to a variable. Replicating a resource to the response.

Example

Replicate to a Variable

<idoc>  <instr>
    <type>copy</type>
    <operand>foo.xml</operand>
    <target>var:vbar</target>
  </instr>
</idoc>

An example of copying a resource into a variable

Replicate a Variable to the Response Document

<idoc>
  <instr>
    <type>copy</type>
    <operand>foo.xml</operand>
    <target>var:vbar</target>
  </instr>
  <instr>
    <type>copy</type>
    <operand>var:vbar</operand>
    <target>this:response</target>
  </instr>
</idoc>

An example of copying a resource into a variable and then copy that variable to the response


(C) 2003, 1060 Research Limited
© 2003,2004, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.