public class JaxpDOMParser extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Document |
document
The document which spawns elements.
|
| Constructor and Description |
|---|
JaxpDOMParser()
Creates a non-validating parser.
|
JaxpDOMParser(boolean validating)
Creates a parser.
|
| Modifier and Type | Method and Description |
|---|---|
DOMWrapper |
create(String tagName)
Creates a wrapper representing an XML element.
|
void |
error(SAXParseException ex)
Error.
|
void |
fatalError(SAXParseException ex)
Fatal error.
|
Location |
getLocation(DOMWrapper wrapper) |
protected void |
handleErrors() |
boolean |
isKeepPositions()
Returns whether the parser is retaining position information.
|
DOMWrapper |
parse(InputStream is)
Parses an input stream and returns a wrapped element.
|
DOMWrapper |
parse(Reader reader)
Parses the contents of a reader and returns a wrapped element.
|
DOMWrapper |
parse(String xmlString)
Parses a string and returns a wrapped element.
|
DOMWrapper |
parse(URL url)
Parses the contents of a URL and returns a wrapped element.
|
protected Document |
parseInputSource(InputSource in)
Parses the specified URI and returns the document.
|
protected void |
prepareParse() |
void |
setKeepPositions(boolean keepPositions)
Sets whether to retain position information.
|
void |
warning(SAXParseException ex)
Warning.
|
protected Document document
public JaxpDOMParser()
throws XOMException
XOMExceptionpublic JaxpDOMParser(boolean validating)
throws XOMException
XOMExceptionprotected Document parseInputSource(InputSource in) throws XOMException
in - Input sourceXOMException - on errorpublic DOMWrapper create(String tagName)
Parserpublic DOMWrapper parse(InputStream is) throws XOMException
Parserparse in interface Parseris - Input streamXOMException - on errorpublic void setKeepPositions(boolean keepPositions)
ParsersetKeepPositions in interface ParserkeepPositions - Whether to keep position information.public boolean isKeepPositions()
ParserisKeepPositions in interface Parserpublic DOMWrapper parse(String xmlString) throws XOMException
Parserparse in interface ParserxmlString - XML stringXOMException - on errorpublic DOMWrapper parse(Reader reader) throws XOMException
Parserparse in interface Parserreader - ReaderXOMException - on errorpublic void warning(SAXParseException ex)
warning in interface ErrorHandlerpublic void error(SAXParseException ex)
error in interface ErrorHandlerpublic void fatalError(SAXParseException ex) throws SAXException
fatalError in interface ErrorHandlerSAXExceptionpublic DOMWrapper parse(URL url) throws XOMException
Parserparse in interface Parserurl - URLXOMException - on errorprotected void prepareParse()
protected void handleErrors()
throws XOMException
XOMExceptionpublic Location getLocation(DOMWrapper wrapper)
getLocation in interface LocatorCopyright © 2012–2020 Julian Hyde. All rights reserved.