Package org.basex.io.parse.xml
Class XmlParser
- java.lang.Object
-
- org.basex.io.parse.xml.XmlParser
-
public final class XmlParser extends Object
Standard XML parser.- Author:
- BaseX Team 2005-22, BSD License, Christian Gruen
-
-
Constructor Summary
Constructors Constructor Description XmlParser()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description XmlParser
contentHandler(ContentHandler handler)
Sets a content handler.void
parse(InputStream stream)
Sets a content handler.static XMLReader
reader(boolean dtd, boolean xinclude)
Returns an XML reader.
-
-
-
Constructor Detail
-
XmlParser
public XmlParser() throws SAXException, ParserConfigurationException
Constructor.- Throws:
SAXException
- SAX exceptionParserConfigurationException
- parser configuration exception
-
-
Method Detail
-
contentHandler
public XmlParser contentHandler(ContentHandler handler)
Sets a content handler.- Parameters:
handler
- content handler- Returns:
- self reference
-
parse
public void parse(InputStream stream) throws IOException, SAXException
Sets a content handler.- Parameters:
stream
- input stream- Throws:
IOException
- I/O exceptionSAXException
- SAX exception
-
reader
public static XMLReader reader(boolean dtd, boolean xinclude) throws SAXException, ParserConfigurationException
Returns an XML reader.- Parameters:
dtd
- parse DTDsxinclude
- enable XInclude- Returns:
- reader
- Throws:
SAXException
- SAX exceptionParserConfigurationException
- parser configuration exception
-
-