public final class XMLUtils extends Object
Modifier and Type | Method and Description |
---|---|
static SAXParser |
getParser(boolean validating)
Returns the requested SAX Parser factory.
|
static void |
parse(ContentHandler handler,
File xml)
Parses the specified file using the given handler.
|
static void |
parse(ContentHandler handler,
File xml,
boolean validate)
Parses the specified file using the given handler.
|
static void |
parse(ContentHandler handler,
Reader reader,
boolean validate)
Parses the specified file using the given handler.
|
public static void parse(ContentHandler handler, File xml) throws BerliozException
handler
- The content handler to use.xml
- The XML file to parse.BerliozException
- Should something unexpected happen.public static void parse(ContentHandler handler, Reader reader, boolean validate) throws BerliozException
handler
- The content handler to use.reader
- The reader over the XML to parse.validate
- whether to validate or not.BerliozException
- Should something unexpected happen.public static void parse(ContentHandler handler, File xml, boolean validate) throws BerliozException
handler
- The content handler to use.xml
- The XML file to parse.validate
- whether to validate or not.BerliozException
- Should something unexpected happen.public static SAXParser getParser(boolean validating) throws BerliozException
validating
- true
for the validating factory;
false
for the non-validating factory;BerliozException
- If one of the features is not recognised or supported by the factory.Copyright © 2016 Allette Systems. All rights reserved.