Reputation: 396
I try a simple groovy script.
def builder = new groovy.xml.MarkupBuilder(out)
builder.ul{
li {
a( href : "href.html" ) {
span(class:"class")
"Content"
}
}
}
output:
<ul>
<li>
<a href='href.html'>
<span class='class' />
</a>
</li>
</ul>
my Question is why "Content" is missing? How could i fix this.
Groovy version 1.7.10
EDIT:
what i wanted is ("Content" outside <span>
)
<ul>
<li>
<a href='href.html'>
<span class='class' />
Content
</a>
</li>
</ul>
Upvotes: 1
Views: 6290
Reputation: 50245
UPDATE:
With latest edit to question, answer should be:
builder.ul{
li {
a( href : "href.html" ) {
span class:"class"
mkp.yield "Content"
}
}
}
Upvotes: 4