pc:call

Previous Next

Executes processing instructions represented by nodes located in a different script file, or in a different part of the current script file. These are instructions in the "Processing.Command" namespace, such as <pc:assign-var>.

Syntax

<pc:call

   {
     filepath = "file-pathxpath ="xpath >> node-set"  |

     resource = "resource-name"

   }

/>

The required xpath must be an XPath expression evaluating to a node set. This expression identifies the nodes to be executed.

The optional filepath must evaluate to a path, and is required if you want to point at nodes in a different script file. If filepath is specified, the root node of the XML document it refers to is used as the context node for evaluating xpath. If filepath is not specified, the current node is used as the context node for evaluating xpath.

An alternative is to call a resource. Use the resource attribute and provide a resource name.

Example 1

This example outputs the result of executing the <pc:value-of> directive that is the parent node of the context node.

<pc:call xpath="../pc:value-of"  />

 

Example 2

This example executes all instructions in the "Processing.Command" namespace that are returned by xpath. The context node for evaluating xpath is the root node of the "env.xml" document in the file system.

<pc:call 
     filepath="env.xml" 
     xpath="/env/pc:defs/computers/computer[@name=environment:MachineName()]/servers/server/pc:*"  />

 

See also

Script control