Groovy Documentation

## org.codehaus.groovy.tools.xml
[Java] Class DomToGroovy

    java.lang.Object
      org.codehaus.groovy.tools.xml.DomToGroovy

    public class DomToGroovy
    extends java.lang.Object

A SAX handler for turning XML into Groovy scripts

Authors:
  James Strachan
  paulk

Field Summary
`protected boolean` | `inMixed`
`protected java.util.Collection` | `keywords`
`protected IndentPrinter` | `out`
`protected java.lang.String` | `qt`

Constructor Summary
`DomToGroovy(java.io.PrintWriter out)`
`DomToGroovy(IndentPrinter out)`

Method Summary
`protected boolean` | `checkEscaping(java.lang.String localName)`
`protected void` | `defineNamespace(java.util.Map namespaces, java.lang.String prefix, java.lang.String uri)`
`protected java.util.Map` | `defineNamespaces(org.w3c.dom.Element element, java.util.Map namespaces)`
`protected java.lang.String` | `escapeQuote(java.lang.String text)`
`protected java.lang.String` | `getAttributeValue(org.w3c.dom.Attr attribute)`
`protected java.lang.String` | `getLocalName(Node node)`
`protected java.lang.String` | `getTextNodeData(org.w3c.dom.Text node)`
`static void` | `main(java.lang.String[] args)`
`protected boolean` | `mixedContent(NodeList list)`
`protected static org.w3c.dom.Document` | `parse(java.lang.String fileName)`
`static org.w3c.dom.Document` | `parse(java.io.File file)`
`static org.w3c.dom.Document` | `parse(java.io.Reader input)`
`static org.w3c.dom.Document` | `parse(java.io.InputStream input)`
`void` | `print(org.w3c.dom.Document document)`
`protected void` | `print(Node node, java.util.Map namespaces, boolean endWithComma)`
`protected void` | `print(java.lang.String text)`
`protected void` | `printAttributeWithPrefix(org.w3c.dom.Attr attribute, java.lang.StringBuffer buffer)`
`protected boolean` | `printAttributeWithoutPrefix(org.w3c.dom.Attr attribute, boolean hasAttribute)`
`protected boolean` | `printAttributes(org.w3c.dom.Element element)`
`protected void` | `printChildren(Node parent, java.util.Map namespaces)`
`protected void` | `printComment(org.w3c.dom.Comment comment, boolean endWithComma)`
`protected void` | `printElement(org.w3c.dom.Element element, java.util.Map namespaces, boolean endWithComma)`
`protected void` | `printEnd(java.lang.String text, boolean endWithComma)`
`protected void` | `printIndent()`
`protected void` | `printPI(org.w3c.dom.ProcessingInstruction instruction, boolean endWithComma)`
`protected void` | `printQuoted(java.lang.String text)`
`protected void` | `printText(org.w3c.dom.Text node, boolean endWithComma)`
`protected void` | `println(java.lang.String text)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### inMixed

    protected boolean inMixed

### keywords

    protected java.util.Collection keywords

### out

    protected IndentPrinter out

### qt

    protected java.lang.String qt

Constructor Detail

### DomToGroovy

    public DomToGroovy(java.io.PrintWriter out)

### DomToGroovy

    public DomToGroovy(IndentPrinter out)

Method Detail

### checkEscaping

    protected boolean checkEscaping(java.lang.String localName)

### defineNamespace

    protected void defineNamespace(java.util.Map namespaces, java.lang.String prefix, java.lang.String uri)

### defineNamespaces

    protected java.util.Map defineNamespaces(org.w3c.dom.Element element, java.util.Map namespaces)

### escapeQuote

    protected java.lang.String escapeQuote(java.lang.String text)

### getAttributeValue

    protected java.lang.String getAttributeValue(org.w3c.dom.Attr attribute)

### getLocalName

    protected java.lang.String getLocalName(Node node)

### getTextNodeData

    protected java.lang.String getTextNodeData(org.w3c.dom.Text node)

### main

    public static void main(java.lang.String[] args)

### mixedContent

    protected boolean mixedContent(NodeList list)

### parse

    protected static org.w3c.dom.Document parse(java.lang.String fileName)

### parse

    public static org.w3c.dom.Document parse(java.io.File file)

### parse

    public static org.w3c.dom.Document parse(java.io.Reader input)

### parse

    public static org.w3c.dom.Document parse(java.io.InputStream input)

### print

    public void print(org.w3c.dom.Document document)

### print

    protected void print(Node node, java.util.Map namespaces, boolean endWithComma)

### print

    protected void print(java.lang.String text)

### printAttributeWithPrefix

    protected void printAttributeWithPrefix(org.w3c.dom.Attr attribute, java.lang.StringBuffer buffer)

### printAttributeWithoutPrefix

    protected boolean printAttributeWithoutPrefix(org.w3c.dom.Attr attribute, boolean hasAttribute)

### printAttributes

    protected boolean printAttributes(org.w3c.dom.Element element)

### printChildren

    protected void printChildren(Node parent, java.util.Map namespaces)

### printComment

    protected void printComment(org.w3c.dom.Comment comment, boolean endWithComma)

### printElement

    protected void printElement(org.w3c.dom.Element element, java.util.Map namespaces, boolean endWithComma)

### printEnd

    protected void printEnd(java.lang.String text, boolean endWithComma)

### printIndent

    protected void printIndent()

### printPI

    protected void printPI(org.w3c.dom.ProcessingInstruction instruction, boolean endWithComma)

### printQuoted

    protected void printQuoted(java.lang.String text)

### printText

    protected void printText(org.w3c.dom.Text node, boolean endWithComma)

### println

    protected void println(java.lang.String text)

Groovy Documentation