org.activemath.fileBased
Class XMLValidate

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.activemath.fileBased.XMLValidate
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XMLValidate
extends DefaultHandler

A simple XML validation tool based on the validation capability of a parser.

Parts of this class is based on Xerces samples' SAX2Writer.

Version:

Constructor Summary
XMLValidate(String parserName, String inSource)
           
 
Method Summary
 void error(SAXParseException ex)
          Error.
 void fatalError(SAXParseException ex)
          Fatal error.
static void main(String[] args)
           
static void printHelp()
           
 void warning(SAXParseException ex)
          Warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLValidate

public XMLValidate(String parserName,
                   String inSource)
            throws Exception
Throws:
Exception
Method Detail

main

public static void main(String[] args)

printHelp

public static void printHelp()

warning

public void warning(SAXParseException ex)
Warning.

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler

error

public void error(SAXParseException ex)
           throws SAXException
Error.

Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
Fatal error.

Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
Throws:
SAXException