be.ac.ulg.montefiore.run.totem.util
Class XMLFilesValidator

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.util.XMLFilesValidator

public class XMLFilesValidator
extends java.lang.Object

This class is a generic XML files validator.

Creation date: 23-mai-2005

Author:
Jean Lepropre (lepropre@run.montefiore.ulg.ac.be)

Constructor Summary
XMLFilesValidator()
           
 
Method Summary
 boolean validate(java.lang.String fileName)
          Validates the XML file fileName using the schema specified in the XML file.
 boolean validate(java.lang.String fileName, java.lang.String schemaLocation)
          Validates the XML file fileName using the schema located at schemaLocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLFilesValidator

public XMLFilesValidator()
Method Detail

validate

public boolean validate(java.lang.String fileName)
Validates the XML file fileName using the schema specified in the XML file.

Parameters:
fileName - The XML file to validate.
Returns:
true if the XML file is valid and false otherwise.

validate

public boolean validate(java.lang.String fileName,
                        java.lang.String schemaLocation)
Validates the XML file fileName using the schema located at schemaLocation.

Parameters:
fileName - The XML file to validate.
schemaLocation - The location of the schema to use. This can be an URL. If the scheme (file://, http://, ...) is not provided, it defaults to file.
Returns:
true if the XML file is valid and false otherwise.


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.