Subsequence

A subsequence is a temporary branching from the main sequence of arguments that enables you to apply more than one operation to the same buffer instance. It saves you having to write separate commands and from creating temporary files in cases where you want to feed the same buffer into more than one operation.

Railroad diagram for grammar entity Subsequence in Xoom Processor.

Subsequence
         ::= '(' ( Subsequence | Operation | XmlFormat )+ ')'

Most operations replace the buffer's content with their response and consequently that response is carried through to the next operation. That is to say, a document fed into such an operation is discarded from memory and cannot be fed into another operation.

This is usually the desired behaviour, but sometimes you may wish to perform multiple operations on the same document. Examples include: creating multiple reports from the same configuration, or sending the same configuration to multiple Xoom servers. When this is the case, you need to use a subsequence. A subsequence creates its own inner buffer, and copies the contents of the outer buffer into it. Any operations performed within the subsequence modify its inner buffer, but leave the outer buffer intact.

Subsequences can be nested. However, you should try to avoid creating unnecessary subsequences due to their cost in performance and memory consumption.
Note: It is important that both the opening and the closing parentheses are preceded and followed by a space. Without the space they will be lumped together with whatever they are attached to by the standard command line parsing process, and won't be correctly interpreted by Xoom Processor.

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.