Are XmlParser and XmlSlurper namespace aware by default?

When answering this question How to read values from XML Request and write into XML Response using Groovy? related to namespaces (SOAP) with XmlSlurper and XmlParser, I realized that I was actually not able to tell if they are non-namespace-aware by default.

While documentation says so (non-namespace-aware by default):

XmlSlurper

XmlSlurper ()

Creates a non-validating and non-namespace-aware
XmlSlurper which does not allow DOCTYPE declarations in documents.

XmlParser

XmlParser ()

Creates a non-validating and non-namespace-aware
XmlParser which does not allow DOCTYPE declarations in documents.

Code is exactly the opposite (namespace-aware by default):

XmlSlurper:

public XmlSlurper() throws ParserConfigurationException, SAXException {
    this(false, true);
}

XmlParser:

public XmlParser() throws ParserConfigurationException, SAXException {
    this(false, true);
}

I found also this answer claiming that XMLSlurper is non-namespace aware by default.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s