public class ValidationResolverHandler extends DefaultHandler2 implements LSResourceResolver
XMLSAXParser to validate an
XML File without using a Schema Validator.XMLSAXParser.setSchemaValidator(boolean)| Constructor and Description |
|---|
ValidationResolverHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
error(SAXParseException e)
Parsing errors will be silently ignored if they are encountered before the
beginning of the Document and an alternated public DTD has been defined for the
handler.
|
void |
fatalError(SAXParseException e)
Parsing errors will be silently ignored if they are encountered before the
beginning of the Document and an alternated public DTD or resolver has been defined for the
handler.
|
EntityListResolver |
getEntityResolver()
Return the entity resolver to use with this handler.
|
InputSource |
resolveEntity(String publicID,
String systemID)
Resolves publicIDs and systemIDs.
|
InputSource |
resolveEntity(String name,
String publicID,
String baseURI,
String systemID)
Resolves publicIDs and systemIDs.
|
LSInput |
resolveResource(String type,
String namespaceURI,
String publicID,
String systemID,
String baseURI)
Allow the application to resolve external resources.
|
void |
setEntityResolver(EntityListResolver resolver)
Set the entity resolver to use with this handler(null by default).
|
void |
setErrorHandler(ResolverSAXHandler errorHandler)
Set the associated error handler.
|
void |
warning(SAXParseException e)
Parsing errors will be silently ignored if they are encountered before the
beginning of the Document and an alternated public DTD or resolver has been defined for the
handler.
|
attributeDecl, comment, elementDecl, endCDATA, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, startCDATA, startDTD, startEntitycharacters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDeclpublic void setErrorHandler(ResolverSAXHandler errorHandler)
errorHandler - the associated error handlerpublic void error(SAXParseException e)
error in interface ErrorHandlererror in class DefaultHandlerpublic void fatalError(SAXParseException e)
fatalError in interface ErrorHandlerfatalError in class DefaultHandlerpublic void warning(SAXParseException e)
warning in interface ErrorHandlerwarning in class DefaultHandlerpublic void setEntityResolver(EntityListResolver resolver)
resolver - the entity resolverpublic EntityListResolver getEntityResolver()
public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException
resolveEntity in interface EntityResolverresolveEntity in class DefaultHandler2publicID - the publicIDsystemID - The system identifier, a URI reference of the external resource being referenced, or null if no
system identifier was suppliedSAXExceptionIOExceptionpublic InputSource resolveEntity(String name, String publicID, String baseURI, String systemID) throws SAXException, IOException
resolveEntity in interface EntityResolver2resolveEntity in class DefaultHandler2name - the entity namepublicID - The public identifier of the external entity being referenced, or null if no public identifier was
suppliedbaseURI - The absolute base URI of the resource being parsed, or null if there is no base URI.systemID - The system identifier, a URI reference of the external resource being referenced, or null if no
system identifier was suppliedSAXExceptionIOExceptionpublic LSInput resolveResource(String type, String namespaceURI, String publicID, String systemID, String baseURI)
resolveResource in interface LSResourceResolvertype - The type of the resource being resolved. For XML resources applications must use the value
"http://www.w3.org/TR/REC-xml". For XML Schema, applications must use the value
"http://www.w3.org/2001/XMLSchema".namespaceURI - The namespace of the resource being resolvedpublicID - The public identifier of the external entity being referenced, or null if no public identifier was
suppliedsystemID - The system identifier, a URI reference of the external resource being referenced, or null if no
system identifier was suppliedbaseURI - The absolute base URI of the resource being parsed, or null if there is no base URI.