Cernunnos Manual


${commentNode()}

Description:

Creates a new XML comment node from the specified VALUE.

Reagents:

Name XPath Description Reagent Type Expected Type Required
VALUE descendant-or-self::text() String expression that will be converted into a camment node. The default is the value of the 'Attributes.STRING' request attribute. PHRASE java.lang.String No

Examples:

Parses the 'books.xml' document, adds a '<book>' child element, places a comment before the '<book>' element, then writes the file back to the same location:

 
       
        <with-attribute key="Attributes.NODE" value="${parseXml(example.xml)}"> 
          <append-node> 
            <book author="George Eliot"> 
              <title>Middlemarch</title> 
            </book> 
          </append-node>  
          <prepend-node node="${commentNode(This is a great book!)}" sibling="${singleNode(book)}"/>  
          <write-document file="books.xml"/> 
        </with-attribute>