|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.util.SchemaValidator
public class SchemaValidator
Creates a validating parser and tries to parse a document with schema validation turned on. Needs the apache.org xerces XML parser.
| Field Summary | |
|---|---|
private Exception |
lastError
The exception that caused a validation failure. |
private SAXBuilder |
xmlbuilder
A SAX builder with schema validation turned on. |
| Constructor Summary | |
|---|---|
SchemaValidator()
Create an instance of the SchemaValidator. |
|
| Method Summary | |
|---|---|
Exception |
getLastError()
Get the exception that caused a validation failure. |
static void |
main(String[] args)
Creates an instance of SchemaValidator and loads the document specified on the command line. |
boolean |
validate(Document xml)
Validate a document with the schema validating parser. |
boolean |
validate(Element xml)
Convenience method to validate an Element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private SAXBuilder xmlbuilder
private Exception lastError
| Constructor Detail |
|---|
public SchemaValidator()
throws VerinecException
VerinecException - if the validator can not be instantiated.| Method Detail |
|---|
public static void main(String[] args)
throws Throwable
args - Expects one String denoting the filename to be parsed.
Throwable - does not catch errors.
public boolean validate(Element xml)
throws VerinecException
xml - element to validate, variables resovled.
VerinecException - If the XML can not be serialized (Should never happen).validate(Document)
public boolean validate(Document xml)
throws VerinecException
xml - The document to validate.
VerinecException - If the XML can not be serialized (Should never happen).public Exception getLastError()
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||