@groovy.transform.CompileStatic class XmlUtils extends java.lang.Object
Utility methods for handling XML.
| Modifiers | Name | Description |
|---|---|---|
static class |
XmlUtils.Format |
Rendering options for XML generated by toXml(Format, Closure). |
static class |
XmlUtils.SlurperConfig |
XML parser configuration used by newXmlSlurper(SlurperConfig) and org.apache.grails.testing.http.client.TestHttpResponse#withXmlSlurper(XmlUtils.SlurperConfig). |
| Constructor and description |
|---|
XmlUtils() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static groovy.xml.XmlSlurper |
newXmlSlurper(JsonUtils.SlurperConfig slurperConfig)Creates an groovy.xml.XmlSlurper with secure defaults. |
|
static java.lang.String |
toXml(java.text.Format format, groovy.lang.Closure<?> dsl)Renders XML from the given groovy.xml.MarkupBuilder DSL closure using the optionally provided rendering options. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Creates an groovy.xml.XmlSlurper with secure defaults.
The default parser is namespace aware, non-validating, permits inline DOCTYPE declarations, and disables external entity expansion plus external DTD loading.
slurperConfig - optional XML parser configuration or custom factoryRenders XML from the given groovy.xml.MarkupBuilder DSL closure using the optionally provided rendering options.
format - optional formatting optionsdsl - the closure that produces the XML markup