Package groovy.xml
Class MarkupBuilderHelper
java.lang.Object
groovy.xml.MarkupBuilderHelper
A helper class for MarkupBuilder.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidProduce a comment in the output.voidProduce an XML processing instruction in the output.voidxmlDeclaration(Map<String, Object> args) Produce an XML declaration in the output.voidPrints data in the body of the current tag, escaping XML entities.voidPrints data in the body of the current tag, escaping XML entities.voidyieldUnescaped(Object value) Print data in the body of the current tag.voidyieldUnescaped(String value) Print data in the body of the current tag.
- 
Constructor Details- 
MarkupBuilderHelper- Parameters:
- builder- the builder to delegate to
 
 
- 
- 
Method Details- 
yieldPrints data in the body of the current tag, escaping XML entities. For example:mkp.yield('5 < 7')- Parameters:
- value- an Object whose toString() representation is to be printed
 
- 
yieldPrints data in the body of the current tag, escaping XML entities. For example:mkp.yield('5 < 7')- Parameters:
- value- text to print
 
- 
yieldUnescapedPrint data in the body of the current tag. Does not escape XML entities. For example:mkp.yieldUnescaped('I am <i>happy</i>!').- Parameters:
- value- an Object whose toString() representation is to be printed
 
- 
yieldUnescapedPrint data in the body of the current tag. Does not escape XML entities. For example:mkp.yieldUnescaped('I am <i>happy</i>!').- Parameters:
- value- the text or markup to print.
 
- 
commentProduce a comment in the output.mkp.comment 'string'is equivalent tomkp.yieldUnescaped '<!-- string -->'. To create an element with the name 'comment', you need to supply empty attributes, e.g.:comment('hello1')ormkp.comment('hello1')will produce:<!-- hello1 --> while:comment('hello2', [:])will produce:<comment>hello2</comment> - Parameters:
- value- the text within the comment.
 
- 
xmlDeclarationProduce an XML declaration in the output. For example:mkp.xmlDeclaration(version:'1.0') - Parameters:
- args- the attributes for the declaration
 
- 
piProduce an XML processing instruction in the output. For example:mkp.pi("xml-stylesheet":[href:"mystyle.css", type:"text/css"])- Parameters:
- args- a map with a single entry whose key is the name of the processing instruction and whose value is the attributes for the processing instruction.
 
 
-