jastrachan | 15 Apr 14:14 2004

Re: Builders :- CDATA / plain text / escape mechanism ?

Incidentally in XML speak, 'mixed content' means an element containing 
text and other elements. This is different from an element with 
attributes and text...

On 15 Apr 2004, at 13:07, Thomas Heller wrote:
>> There's no reason why you couldn't just use XML/HTML markup for mixed 
>> content
>> p("Mary had a <b>little</b> lamb")
> Hi,
> I think mixed content is quite important. If you want to take 
> advantage of a Groovy Builder to generate HTML for you you will 
> (sooner or later) need mixed content when it comes to CSS.
> For example:
> <p id="testp" class="red">Mary had a <b>little</b> lamb</p>
> p(id:'testp', class:'red') { text("Mary had a <b>little</b> lamb") }
> I don't think that text() is a good idea since it will be reserved 
> word and <text /> will be impossible then.
> But how about:
> p(id:'testp', content:"Mary had a <b>little</b> lamb");

We could solve the attributes and text issue via

p(id:'testp') { "Mary had a <b>little</b> lamb" }

This doesn't work so cleanly for mixed content though.