Blend input parameters

Previous Next

When calling USCSXSL for processing Blend scripts, you can pass any number of optional name-value pairs as Blend input parameters.

When calling from the command line, variable-name and variable-value are connected by an equal sign ( = ). If you have multiple variable-name=variable-value pairs, they are separated by spaces. You cannot have spaces as part of variable-name or variable-value:

variable-name=variable-value ... 

 

When calling from a USoft context, variable-name and variable-value are regular string parameters. They are strings surrounded by single quotes and separated by commas. If you have multiple variable-name, variable-value pairs, they are separated by commas. You can have spaces as part of variable-value but not as part of variable-name:

, variable-name, variable-value ... 

 

Inside the Blend script, refer to variable-value by the placeholder:

$variable-name

 

TIP: You can provide a default value for a parameter in case it is not passed when your script is called. Use the <pc:assign-default> directive.

 

Example

If you call by the following command line:

usoft-bindir\ublendit.exe deletetwofiles.xml file_name_1=deletethisone.xml file_name_2=deletethisonetoo.xml

the following "deletetwofiles.xml" Blend script:

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:pc="Processing.Command">
  <pc:assign workingdir="{directories:Get()}"/>
  <pc:assign thisfile="{$file_name_1}"/>
  <pc:assign thatfile="{$file_name_2}"/>
 
  <pc:assign deletefile1="{path:Combine($workingdir,$thisfile)}"/>
  <pc:assign deletefile2="{path:Combine($workingdir,$thatfile)}"/>
 
  <pc:DeleteFile source="{$deletefile1}"/>
  <pc:DeleteFile source="{$deletefile2}"/>
</root>

then this script will delete from the current directory the following files:

deletethisone.xml
deletethisonetoo.xml

Contexts for Blend input parameters

The following are legal contexts for Blend input parameters:

From the command line:

 

usoft-bindir\ublendit.exe xml-filepath variable-name=variable-value ... ]
 
> usoft-bindir\ublendit.exe xml-filepath xsl-filepath variable-name=variable-value ... ]

 

From a USoft context:

select uscsxsl.blend( xml  [ , variable-name, variable-value ... ] )
 
select uscsxsl.apply( xml, xsl  [ , variable-name, variable-value ... ] )
 
select uscsxsl.apply2file( xml, xsl, xml-resultfilepath  [ , variable-name, variable-value ... ] )

 

 

See also

Calling USCSXSL