Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor and description |
---|
XmlSlurper
() Creates a non-validating and non-namespace-aware XmlSlurper which does not allow DOCTYPE declarations in documents. |
XmlSlurper
(boolean validating, boolean namespaceAware) Creates a XmlSlurper which does not allow DOCTYPE declarations in documents. |
XmlSlurper
(boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration) Creates a XmlSlurper . |
XmlSlurper
(XMLReader reader) |
XmlSlurper
(SAXParser parser) |
Type | Name and description |
---|---|
void |
characters(char[] ch, int start, int length) |
void |
endDocument() |
void |
endElement(String namespaceURI, String localName, String qName) |
DTDHandler |
getDTDHandler() |
GPathResult |
getDocument() @return The GPathResult instance created by consuming a stream of SAX events Note if one of the parse methods has been called then this returns null Note if this is called more than once all calls after the first will return null |
EntityResolver |
getEntityResolver() |
ErrorHandler |
getErrorHandler() |
boolean |
getFeature(String uri) |
Object |
getProperty(String uri) |
void |
ignorableWhitespace(char[] buffer, int start, int len) |
boolean |
isKeepIgnorableWhitespace() @return true if ignorable whitespace is kept |
GPathResult |
parse(InputSource input) Parse the content of the specified input source into a GPathResult object |
GPathResult |
parse(File file) Parses the content of the given file as XML turning it into a GPathResult object |
GPathResult |
parse(InputStream input) Parse the content of the specified input stream into an GPathResult Object. |
GPathResult |
parse(Reader in) Parse the content of the specified reader into a GPathResult Object. |
GPathResult |
parse(String uri) Parse the content of the specified URI into a GPathResult Object |
GPathResult |
parseText(String text) A helper method to parse the given text as XML |
void |
setDTDHandler(DTDHandler dtdHandler) |
void |
setEntityBaseUrl(URL base) Resolves entities against using the supplied URL as the base for relative URLs |
void |
setEntityResolver(EntityResolver entityResolver) |
void |
setErrorHandler(ErrorHandler errorHandler) |
void |
setFeature(String uri, boolean value) |
void |
setKeepIgnorableWhitespace(boolean keepIgnorableWhitespace)
|
void |
setKeepWhitespace(boolean keepWhitespace) @deprecated use setKeepIgnorableWhitespace |
void |
setProperty(String uri, Object value) |
void |
startDocument() |
void |
startElement(String namespaceURI, String localName, String qName, Attributes atts) |
void |
startPrefixMapping(String tag, String uri) |
Methods inherited from class | Name |
---|---|
class DefaultHandler |
startDocument, endDocument, processingInstruction, ignorableWhitespace, startElement, endElement, characters, endPrefixMapping, fatalError, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, error, warning, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Creates a non-validating and non-namespace-aware XmlSlurper
which does not allow DOCTYPE declarations in documents.
Creates a XmlSlurper
which does not allow DOCTYPE declarations in documents.
validating
- true
if the parser should validate documents as they are parsed; false otherwise.namespaceAware
- true
if the parser should provide support for XML namespaces; false
otherwise. Creates a XmlSlurper
.
validating
- true
if the parser should validate documents as they are parsed; false otherwise.namespaceAware
- true
if the parser should provide support for XML namespaces; false
otherwise.allowDocTypeDeclaration
- true
if the parser should provide support for DOCTYPE declarations; false
otherwise.
Parse the content of the specified input source into a GPathResult object
input
- the InputSource to parseParses the content of the given file as XML turning it into a GPathResult object
file
- the File to parseParse the content of the specified input stream into an GPathResult Object. Note that using this method will not provide the parser with any URI for which to find DTDs etc. It is up to you to close the InputStream after parsing is complete (if required).
input
- the InputStream to parseParse the content of the specified reader into a GPathResult Object. Note that using this method will not provide the parser with any URI for which to find DTDs etc. It is up to you to close the Reader after parsing is complete (if required).
in
- the Reader to parseParse the content of the specified URI into a GPathResult Object
uri
- a String containing the URI to parseA helper method to parse the given text as XML
text
- a String containing XML to parseResolves entities against using the supplied URL as the base for relative URLs
base
- The URL used to resolve relative URLs
keepIgnorableWhitespace
- If true then ignorable whitespace (i.e. whitespace before elements) is kept.
The default is to discard the whitespace.keepWhitespace
- If true then whitespace before elements is kept.
The default is to discard the whitespace.Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.