EntityResolver
Can be used for resolving entities during the parsing[1]
XMLSAXParser
class works with the ResolverSAXHandler handler.
XMLSAXParser parser = new XMLSAXParser("My Parser"); parser.setValidating(true); parser.setHandlerDTD(dtd); parser.setHandler(handler); parse.parse(file);
XMLSAXParser parser = new XMLSAXParser("My Parser"); parser.setValidating(true); parser.setSchema(schema); parser.setHandler(handler); parse.parse(file);
XMLSAXParser parser = new XMLSAXParser("My Parser"); parser.setValidating(true); parser.setSchema(schema); parser.setHandler(handler); parser.showExceptions(false); parse.parse(file); if (handler.hasParserExceptions()) { List>ResolverSAXHandler.ExceptionResult> results = handler.getExceptionResults(); }
XMLIncluder includer = new XMLIncluder(<my XML file>); String content = includer.getContent();The XMLNodeIncluder class does the same but uses the xml.tree nodes to create the tree structure.
XMLNodeIncluder includer = new XMLNodeIncluder(<my XML file>); includer.write(<my output XML file>);
Copyright 2006-2024 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences