public class DAXValidator
extends org.xml.sax.helpers.DefaultHandler
Modifier and Type | Field and Description |
---|---|
protected int |
m_errors
Counts the number of errors.
|
protected int |
m_fatals
Counts the number of fatal errors.
|
private org.xml.sax.Locator |
m_location
Keep the location within the document.
|
private org.xml.sax.XMLReader |
m_reader
Holds the instance of a
XMLReader class. |
private java.lang.String |
m_schemafile
what is the name of the schema file in the filename hint?
|
protected boolean |
m_verbose
How verbose should we be?
|
protected int |
m_warnings
Counts the number of warnings.
|
static java.lang.String |
SCHEMA_NAMESPACE
URI namespace for DAX schema.
|
protected static java.lang.String |
vendorParserClass
Default parser is the Xerces parser.
|
Constructor and Description |
---|
DAXValidator(boolean verbose)
default c'tor
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endDocument() |
void |
endElement(java.lang.String nsURI,
java.lang.String localName,
java.lang.String qName) |
void |
error(org.xml.sax.SAXParseException ex) |
void |
fatalError(org.xml.sax.SAXParseException ex) |
private java.lang.String |
full_where() |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
static void |
main(java.lang.String[] args) |
void |
parse(java.lang.String filename) |
private boolean |
prop(java.lang.String uri,
java.lang.Object value)
Sets a SAX property while capturing failed features right here.
|
private boolean |
set(java.lang.String uri,
boolean flag)
Sets a feature while capturing failed features right here.
|
void |
setDocumentLocator(org.xml.sax.Locator locator) |
void |
startDocument() |
void |
startElement(java.lang.String nsURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs) |
boolean |
statistics()
Show how many warnings, errors and fatals were shown.
|
void |
warning(org.xml.sax.SAXParseException ex) |
private java.lang.String |
where() |
protected static final java.lang.String vendorParserClass
public static final java.lang.String SCHEMA_NAMESPACE
private java.lang.String m_schemafile
private org.xml.sax.XMLReader m_reader
XMLReader
class.private org.xml.sax.Locator m_location
protected boolean m_verbose
protected int m_warnings
protected int m_errors
protected int m_fatals
public DAXValidator(boolean verbose) throws java.lang.Exception
java.lang.Exception
private boolean set(java.lang.String uri, boolean flag)
uri
- is the feature's URI to modifyflag
- is the new value to set.private boolean prop(java.lang.String uri, java.lang.Object value)
uri
- is the property's URI to modifyvalue
- is the new value to set.public void warning(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
private java.lang.String full_where()
private java.lang.String where()
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void parse(java.lang.String filename) throws java.lang.Exception
java.lang.Exception
public boolean statistics()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception