Skip to content

Instantly share code, notes, and snippets.

View tleahygoogle-zz's full-sized avatar

Tim Leahy tleahygoogle-zz

  • Google
  • Mountain View, CA
View GitHub Profile
@devilelephant
devilelephant / gist:6554529
Created September 13, 2013 18:48
Groovy XML Markup Builder Tricks: CDATA, declaration, comments
def out = new StringWriter()
def xml = new groovy.xml.MarkupBuilder(out)
// MarkupBuilder gives us an instance of MarkupBuilderHelper named 'mkp'
// MarkupBuilderHelper has several helpful methods
xml.mkp.xmlDeclaration(version: "1.0", encoding: "utf-8")
xml.example {
a {
b {
mkp.comment('a comment')