Cernunnos Manual


<token-iterator>

Description:

Splits the specified STRING into tokens and iterates over them, performing SUBTASKS once for each token in the collection.

Reagents:

Name XPath Description Reagent Type Expected Type Required
STRING @string Textual content that will be split into tokens based on REGEX. The default is the value of the 'Attributes.STRING' request attribute. PHRASE java.lang.String No
REGEX @regex Delimiting regular expression used to split STRING into tokens. PHRASE java.lang.String Yes
SUBTASKS * The set of tasks that are children of this task. NODE_LIST java.util.List No

Examples:

Tests to see if the first argument on the command line contains the colon (':') character; if so, the argument is sepparated into tokens and a new directory is created using each token:

 
       
        <with-attribute key="Attributes.STRING" value="${$1}"> 
          <if test="${groovy(Attributes.STRING.contains(':'))}"> 
            <token-iterator regex=":"> 
              <mkdirs path="${Attributes.STRING}"/> 
            </token-iterator> 
          </if> 
        </with-attribute>