Examples

Examples of commands for common Xoom Processor tasks.

Retrieving and saving a named query

xp :All all.xml All\

Retrieves the All named query from the local Xoom server and saves the result in a file named all.xml and a Xoom folder named All.

Retrieving a named query with spaces in its name

xp "svr1:Logic Configuration" lc.xml

When a query name contains spaces, you need to put the whole source argument in double quotes. In this case, the query named Logic Configuration is retrieved from Xoom server svr1 and saved to a file named lc.xml.

Console output

xp : @

Retrieves the DEFAULT named query from the local Xoom server and outputs it to the console.

Transforming configuration

xp zeus:All % t.xsl zeus-all-transformed.xml

Retrieves the All named query from the Xoom server zeus, transforms the result using the XSLT stylesheet in the file named t.xsl and saves the result to a file named zeus-all-transformed.xml.

Multiple transformations

xp : default.xml % t1.xsl default-t1.xml % t2.xsl default-t1-t2.xml

Retrieves the DEFAULT named query from the local Xoom server, saves the result to a file named default.xml, then transforms the result using the XSLT stylesheet in the file named t1.xsl, saves the result of the transformation to a file named default-t1.xml, then applies a second transformation using the XSLT stylesheet in the file named t2.xsl and saves the twice-transformed result to a file named default-t1-t2.xml.

Using the describe option

xp -d : default.xml % t1.xsl % t2.xsl default-t1-t2.xml

Produces the following description without actually running the operations:

Get from query 'DEFAULT' on server 'localhost' 
       Write to file 'default.xml' 
       Transform using XSL stylesheet from file 't1.xsl' 
       Transform using XSL stylesheet from file 't2.xsl' 
       Write to file 'default-t1-t2.xml'

Using subsequences to generate two reports

xp : ( % trans1.xsl res1.xml ) ( % trans2.xsl res2.xml )

Here, the DEFAULT named query is retrieved from the local Xoom server just once but transformed and the result saved twice, independently. First, the result of the named query is transformed with trans1.xsl and the result of the transformed saved as res1.xml. Next, the result of the named query is transformed with trans2.xsl and the result of the transformation saved as res2.xml.

Nested subsequences

xp : ( % t1.xsl ( % t2a.xsl r2a.xml ) ( % t2b.xsl r2b.xml ) ) ( % t3.xsl r3.xml )

Subsequences may be nested. Here, the DEFAULT named query is retrieved from the local Xoom server and transformed with t1.xsl. The result of t1.xsl is then transformed by t2a.xsl and the result saved as r2a.xml. The result of the same t1.xsl (which is run only once) is also transformed by trans2b.xsl and the result saved as res2b.xml. Finally, the result of the DEFAULT named query is also transformed by t3.xsl and the result saved as r3.xml without the named query being rerun.

Deploying a configuration patch to two Xoom servers

xp --enable-set patch.xml ( server1: response1.xml ) ( server2: response2.xml )

This command deploys XoomXML in the file patch.xml to two live Xoom servers: server1 and server2. After each deployment, the response is saved as response1.xml and response2.xml respectively. At the end of each subsequence the inner buffer containing the Xoom response is discarded, and the outer buffer with the initial source document, in this case patch.xml, becomes the buffer that is fed into further operations or subsequences.

Relative complement

xp :All - ConfigRepo\ diff.xml Diff\
Calculates the configuration changes that need to be applied to get from the baseline stored in the ConfigRepo Xoom folder to the current state of the All named query on the local Xoom server, and stores the result in both a file named diff.xml and a Xoom folder named Diff.

XSLT parameter

xp source.xml % =:ParName1=Val1 t.xsl r.xml
Transforms the contents of source.xml using the XSLT stylesheet t.xsl, with the parameter ParName1 set to Val1. The result of the transformation is saved in r.xml.

As many parameters as required can be specified in this way.

XSLT parameter with spaces in its value

If the parameter value requires spaces, enclose the whole parameter declaration in double quotes, , starting from =:. For example:
xp source.xml % "=:ParWithSpaces=Parameter value with spaces" t.xsl

GetCustomQuery custom command

In this example we want to retrieve a custom query that contains a subset of ClickSchedule logic configuration. This will contain all:

First, create the skeleton query as follows, and save it as LogicQuery.xml. The root element can have any name provided the structure of the skeleton query matches that of XoomXML.
<Root>
  <Objective/>
  <Rule/>
  <Setting>
    <Setting>
      <Category>Background Optimization</Category>
    </Setting>
    <Setting>
      <Category>Decomposition</Category>
    </Setting>
    <Setting>
      <Category>Logic Domains</Category>
    </Setting>
  </Setting>
</Root>
To retrieve the query from the Xoom server with hostname svr1, saving the results as LogicQueryResults.xml, type the following command:
xp LogicQuery.xml svr1::GetCustomQuery LogicQueryResults.xml

XML output formatting

xp source.xml [:indent=1t,c14nrt:] source_c14n.xml
Saves the contents of source.xml as canonical XML indented using a single tab character in file source_c14n.xml.