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, startEntity
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
public void setErrorHandler(ResolverSAXHandler errorHandler)
errorHandler
- the associated error handlerpublic void error(SAXParseException e)
error
in interface ErrorHandler
error
in class DefaultHandler
public void fatalError(SAXParseException e)
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
public void warning(SAXParseException e)
warning
in interface ErrorHandler
warning
in class DefaultHandler
public void setEntityResolver(EntityListResolver resolver)
resolver
- the entity resolverpublic EntityListResolver getEntityResolver()
public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler2
publicID
- the publicIDsystemID
- The system identifier, a URI reference of the external resource being referenced, or null if no
system identifier was suppliedSAXException
IOException
public InputSource resolveEntity(String name, String publicID, String baseURI, String systemID) throws SAXException, IOException
resolveEntity
in interface EntityResolver2
resolveEntity
in class DefaultHandler2
name
- 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 suppliedSAXException
IOException
public LSInput resolveResource(String type, String namespaceURI, String publicID, String systemID, String baseURI)
resolveResource
in interface LSResourceResolver
type
- 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.