Cernunnos Manual


<line-iterator>

Description:

Splits the specified STRING into lines (based on line feed character ASCII 10) and iterates over them, performing SUBTASKS once for each line 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
SUBTASKS * The set of tasks that are children of this task. NODE_LIST java.util.List No

Examples:

Analyzes a Subversion log file, specified by ${$1}, for modified files; writes the path of each modified file to the console once:

 
       
        <with> 
          <attribute key="fileSet">${groovy(new HashSet())}</attribute>  
          <subtasks> 
            <line-iterator string="${contents(${$1})}"> 
              <if test="${groovy(Attributes.STRING.matches('\\A   M .*'))}"> 
                <groovy> 
                  <script>fileSet.add(Attributes.STRING)</script> 
                </groovy> 
              </if> 
            </line-iterator>  
            <for-each items="${fileSet}"> 
              <echo-ln>${Attributes.OBJECT}</echo-ln> 
            </for-each> 
          </subtasks> 
        </with>