|
Re: MarkupBuilder combining attributes and content: msg#00156lang.groovy.user
Hi, I have tried to fix this problem with just a few lines of code change. I am attaching a patchfile with the changes. It's not the most elegant solution, perhaps, but the case statements in that code have painted the XML builder into corners that would take more brain power to undo than I could apply to it tonight.
With the following groovy code it outputs the following HTML: import groovy.xml.MarkupBuilder; xhtml = new MarkupBuilder() html = xhtml.html() { head { title('My Title') } body(bgcolor:"#FFFFFF") { p { a(href:"http://groovy.codehaus.org", "Groovy") a(href:"http://groovy.codehaus.org", "\"Groovy\"") } table { tr { td(class:"special", "cell value") td(class:"special2", "another cell value") } } } } println html HTML ouput: <html> <head> <title>My Title</title> </head> <body bgcolor='#FFFFFF'> <p> <a href='http://groovy.codehaus.org'>Groovy</a> <a href='http://groovy.codehaus.org'>"Groovy"</a> </p> <table> <tr> <td class='special'>cell value</td> <td class='special2'>another cell value</td> </tr> </table> </body> </html> Hope this helps, Scott Stirling Framingham, MA On Nov 22, 2004, at 1:28 PM, Guillaume Laforge wrote: Ken Pelletier wrote:
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | AW: MarkupBuilder combining attributes and content, Joerg Plewe |
|---|---|
| Next by Date: | RE: Ant and Groovy integration (Gravy), Dierk Koenig |
| Previous by Thread: | Re: MarkupBuilder combining attributes and content, Guillaume Laforge |
| Next by Thread: | Re: MarkupBuilder combining attributes and content, Marc Hedlund |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |