com.cysols.iodef
Class IodefXMLValidator
java.lang.Object
com.cysols.iodef.XMLFileWriter
com.cysols.iodef.IodefXMLValidator
public class IodefXMLValidator
- extends XMLFileWriter
Validate XML documents by XML Schema.
- Author:
- cysol
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myTmpFile
protected String myTmpFile
IodefXMLValidator
public IodefXMLValidator()
- Default constractor, initializes.
validate
public void validate(String xml_file)
throws XMLValidationError,
XMLValidationException
- Validates the specified xml file, if some errors are found, throws
XMLValidationError contained all error.
- Parameters:
xml_file - xml file name
- Throws:
XMLValidationException - if writing goes wrong
XMLValidationError - if validation is not passed
validate
public Document validate(IODEFDocument iodef)
throws XMLValidationError,
XMLValidationException
- Validate the specified incident element, and returns XML document included
the specified Incident element.
- Parameters:
iodef - a IODEFDocument elmenet
- Returns:
- XML Document included a incident element
- Throws:
XMLValidationException - if writing goes wrong
XMLValidationError - if validation is not passed
writeToFile
protected void writeToFile(String file,
Document doc)
throws XMLValidationException
- Throws:
XMLValidationException
main
public static void main(String[] args)