I need to build an org.w3c.dom.Document object programmatically and I thought, 
given its name, groovy.xml.DOMBuilder might be useful.  However, the DOMBuilder 
class does not appear to be a “builder” in the same sense that MarkupBuilder 
is.  That is,

        Document document = aDocumentBuilder.newDocument()
        new DOMBuilder(document).root {
                parent {
                        child ‘text’
                        child ‘more text’
                }
        }

does not seem to build a Document.  Am I missing something or does DOMBuilder 
not do what I want?  Writing my only little builder isn’t a problem, but I 
don’t want to reinvent the wheel.

Note:  I am trying to avoid building an XML string and parsing that into a DOM 
object as I am already parsing other data (JSON) and I want to avoid 
JSON->XML->DOM,  I would prefer PARSER_EVENTS -> DOM

Cheers,
Keith

------------------------------
Research Associate
Department of Computer Science
Vassar College
Poughkeepsie, NY


Reply via email to