public class DOMBuilder extends BuilderSupport
A helper class for creating a W3C DOM tree
Constructor and description |
---|
DOMBuilder(Document document) |
DOMBuilder(DocumentBuilder documentBuilder) |
Type Params | Return Type | Name and description |
---|---|---|
|
public static DOMBuilder |
newInstance() |
|
public static DOMBuilder |
newInstance(boolean validating, boolean namespaceAware) |
|
public static Document |
parse(Reader reader) Creates a DocumentBuilder and uses it to parse the XML text read from the given reader. |
|
public static Document |
parse(Reader reader, boolean validating, boolean namespaceAware) Creates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing parser validation and namespace awareness to be controlled. |
|
public static Document |
parse(Reader reader, boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration) Creates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing parser validation, namespace awareness and permission of DOCTYPE declarations to be controlled. |
|
public Document |
parseText(String text) A helper method to parse the given text as XML. |
Methods inherited from class | Name |
---|---|
class BuilderSupport |
invokeMethod, invokeMethod |
class GroovyObjectSupport |
getMetaClass, setMetaClass |
Creates a DocumentBuilder and uses it to parse the XML text read from the given reader. A non-validating, namespace aware parser which does not allow DOCTYPE declarations is used.
reader
- the reader to read the XML text fromCreates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing parser validation and namespace awareness to be controlled. Documents are not allowed to contain DOCYTYPE declarations.
reader
- the reader to read the XML text fromvalidating
- whether to validate the XMLnamespaceAware
- whether the parser should be namespace awareCreates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing parser validation, namespace awareness and permission of DOCTYPE declarations to be controlled.
reader
- the reader to read the XML text fromvalidating
- whether to validate the XMLnamespaceAware
- whether the parser should be namespace awareallowDocTypeDeclaration
- whether the parser should allow DOCTYPE declarationsA helper method to parse the given text as XML.
text
- the XML text to parseCopyright © 2003-2022 The Apache Software Foundation. All rights reserved.