Cernunnos Manual


<echo-ln>

Description:

Prints the specified MESSAGE, followed by a line feed, to the PrintStream specified by STREAM. You may optionally provide a PREFIX.

Reagents:

Name XPath Description Reagent Type Expected Type Required
STREAM @stream Optional PrintStream to which the message should be written. If omitted, this task will use either: (1) the value of the 'Attributes.STREAM' request attribute if present; or (2) System.out. PHRASE java.io.PrintStream No
PREFIX @prefix Characters that preceed the main message. The default is an empty string. PHRASE java.lang.String No
MESSAGE text() Message to write to the specified PrintStream. The default is an empty string. PHRASE java.lang.Object No

Examples:

Parses a document from the resource at 'properties/db/data.xml', creates a node list from the expression '//table/name', and writes the text value of each node to System.out:

 
       
        <node-iterator source="${parseXml(properties/db/data.xml)}" xpath="//table/name"> 
          <echo-ln>${valueOf(.)}</echo-ln> 
        </node-iterator> 
       
    

Invokes 'is-admin.crn' to deturmine if the user is an administrator, then either (1) deletes the file(s) specified on the command prompt or (2) gives the user appropriate feedback:

 
       
        <choose> 
          <when test="${crn(is-admin.crn)}"> 
            <argument-iterator> 
              <delete-file file="${Attributes.STRING}"/> 
            </argument-iterator> 
          </when>  
          <otherwise> 
            <echo-ln>You are not authorized to perform the specified action.</echo-ln> 
          </otherwise> 
        </choose>