public final class XMLHelper extends Object
Most methods in this implementation will forward the exceptions should occur, so they will have to be handled externally.
| Modifier and Type | Method and Description |
|---|---|
static XMLReader |
makeXMLReader(ContentHandler handler)
Creates a non-validating, non-namespace-aware
XMLReader using the specified
ContentHandler. |
static void |
parse(XMLReader xmlreader,
File file)
|
public static XMLReader makeXMLReader(ContentHandler handler) throws SAXException, ParserConfigurationException
XMLReader using the specified
ContentHandler.
If the given ContentHandler is null, the XMLReader is
not initialised.
handler - The content handler to use.XMLReaderSAXException - Should a SAX exception occurParserConfigurationException - Should a parser config exception occurpublic static void parse(XMLReader xmlreader, File file) throws FileNotFoundException, SAXException, IOException
File with the specified XMLReader.
This method assumes the XML is in 'UTF-8', it will not sniff the XML to determine the encoding to use.
xmlreader - The XML reader to use.file - The file to parseFileNotFoundException - If the file does not existsSAXException - Should an SAX exception occurIOException - Should an I/O exception occurCopyright © 2007-2022. All Rights Reserved.