net.wangs.xmlutil
Class XMLValidator

java.lang.Object
  extended bynet.wangs.xmlutil.XMLValidator

public class XMLValidator
extends java.lang.Object

This XMLValidator is a tool to validate an XML file against its refenrenced XML Schema.

 Command line usage: 
    java [-classpath <path>/xerces.jar:<path>/xalan.jar:<path>/jtestcase.jar] 
         jtestcase.XMLValidator <xml-file-name>

 API usage: 
    boolean valid = XMLValidator.validate(String fileName);
 

Author:
Yuqing Wang

Field Summary
protected static java.util.Properties _props
           
protected static java.lang.String mParserVersion
           
 
Constructor Summary
XMLValidator()
          Prepares validating features from property file
 
Method Summary
static java.lang.String _getParserInformation()
          Provides information about the used XML parser.
static void main(java.lang.String[] args)
           
static boolean validate(java.lang.String fileName)
          Validates XML file using either DOMBuilder or SAXParser, based on property "USE_DOMBUILDER".
 boolean validateWithDOMBuilder(java.io.InputStream is)
          Validates XML file using DOMBuilder.
 boolean validateWithSAXParser(java.io.InputStream is)
          Validates XML file using SAXParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_props

protected static java.util.Properties _props

mParserVersion

protected static java.lang.String mParserVersion
Constructor Detail

XMLValidator

public XMLValidator()
Prepares validating features from property file

Method Detail

main

public static void main(java.lang.String[] args)

validate

public static boolean validate(java.lang.String fileName)
                        throws XMLUtilException
Validates XML file using either DOMBuilder or SAXParser, based on property "USE_DOMBUILDER".

Throws:
XMLUtilException

validateWithDOMBuilder

public boolean validateWithDOMBuilder(java.io.InputStream is)
Validates XML file using DOMBuilder.


validateWithSAXParser

public boolean validateWithSAXParser(java.io.InputStream is)
Validates XML file using SAXParser.


_getParserInformation

public static java.lang.String _getParserInformation()
                                              throws java.lang.Exception
Provides information about the used XML parser.

Returns:
A string with the fully qualified parser name
Throws:
java.lang.Exception


Copyright © 2005 . All Rights Reserved.