July 2013
Intermediate to advanced
370 pages
8h 27m
English
Most of us love to hate XML. Working with XML gets harder as the document size increases, and the tools and API support are not pleasant. My theory is that XML is like a human: it starts out cute when it’s small and gets annoying when it becomes bigger.
XML may be a fine format for machines to handle, but it’s rather unwieldy to work with directly. No one really wants to do it, but we’re forced to. Groovy alleviates this a great deal by making working with XML almost fun.
Let’s look at an example of creating XML documents in Groov using a builder:
| UsingBuilders/UsingXMLBuilder.groovy | |
| | bldr = new groovy.xml.MarkupBuilder() |
| | bldr.languages { |
| | language(name: 'C++') { author('Stroustrup')} |
| | language(name: 'Java') { ... |
Read now
Unlock full access