USoft Blend scripts

Previous Next

A USoft Blend script is a valid XML 1.0 document that is meaningfully transformed by the Batch.1.0.xsl transformation found in the \xsl\Util subfolder of your USoft installation folder.

In practice, a Blend script contains Blend directives: XML elements and XML attributes associated by the Batch.1.0.xsl transformation with an extension function.

Each Blend directive is in a predefined namespace, most typically the "Processing.Command" namespace associated with the pc: namespaceprefix. The predefined namespaces for Blend directive are declared at the top of the Batch.1.0.xsl transformation. To use a Blend directive in your script, you must copy the associated namespace declaration to your script. The namespace declaration(s) are most commonly declared as attributes of the document node (the top-level node of the script).

In practice, it is the namespace prefix that signposts a given element as being a Blend directive as opposed to just any XML element.

In practice, the document node can have any name and is not associated with a namespace, and all the remaining elements are Blend directives.

USoft Blend scripts are processed in such a way that the Blend directives are executed and the remaining XML nodes (if any) are copied to the output.

 

Example

This script deletes the "deletethis.xml" file from the file system:

<?xml version="1.0" encoding="UTF-8"?>
<mydocument xmlns:pc="Processing.Command">
   <pc:assign workingdir="{directories:Get()}"/>
   <pc:assign deletefile="{path:Combine($workingdir,'deletethis.xml')}"/>
   <pc:DeleteFile source="{$deletefile}"/>
</mydocument>

The standard output looks like this:

<mydocument>
  <!--files:DeleteFile(c:\myworkingdir\deletethis.xml) -->
</mydocument>

If this script is in a file called "myscript.xml", it is executed from the command line like so:

usoft-bindir\ublendit.exe myscript.xml

 

 

See also

How a USoft Blend script is processed

Calling USCSXSL

Directives