Cernunnos Manual


${newDoc()}

Description:

Creates a new XML Document. If provided, this task also creates a root element with the specified NAME. This task return either the root element (if present) or the document node.

Reagents:

Name XPath Description Reagent Type Expected Type Required
NAME descendant-or-self::text() Optional element name. If provided, this task will create a root element with this NAME and return it. PHRASE java.lang.String No

Examples:

Creates a new XML document containing '<example foo="bar"/>', then writes it to the file 'example.xml':

 
       
        <with-attribute key="Attributes.NODE" value="${newDoc(example)}"> 
          <append-node node="${attributeNode(foo=bar)}"/>  
          <write-document file="example.xml"/> 
        </with-attribute>