|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nih.nci.cagrid.common.SchemaValidator
public class SchemaValidator
SchemaValidator Validates XML documents against a schema. For validating multiple documents against the same schema, create an instance of this class with the schema filename and pass the documents to the validator in succession to save on the overhead of creating new parser factories.
| Field Summary | |
|---|---|
static java.lang.String |
JAXP_SCHEMA_LANGUAGE
|
static java.lang.String |
JAXP_SCHEMA_SOURCE
|
static java.lang.String |
W3C_NAMESPACE
|
| Constructor Summary | |
|---|---|
SchemaValidator(java.lang.String schemaFilename)
Initializes the schema validator to perform validation against an XML Schema |
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
This utility can be run from the command line as well |
void |
validate(java.io.File xmlFile)
Validates the contents of an XML file against the schema |
void |
validate(java.lang.String xml)
Validates XML against the schema |
static void |
validate(java.lang.String xsdFilename,
java.io.File xmlFile)
Validates the contents of an XML file against an xml schema |
static void |
validate(java.lang.String xsdFilename,
java.lang.String xmlText)
Validates xml text against an xml schema |
static void |
verify(java.lang.String xsdFilename)
Verify that a schema is well formed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String JAXP_SCHEMA_LANGUAGE
public static final java.lang.String JAXP_SCHEMA_SOURCE
public static final java.lang.String W3C_NAMESPACE
| Constructor Detail |
|---|
public SchemaValidator(java.lang.String schemaFilename)
throws SchemaValidationException
schemaFilename - The filename of the schema to use for validation
SchemaValidationException| Method Detail |
|---|
public void validate(java.lang.String xml)
throws SchemaValidationException
xml - The XML text to validate
SchemaValidationException
public void validate(java.io.File xmlFile)
throws SchemaValidationException
xmlFile - The file to load XML from for validation
SchemaValidationException
public static void validate(java.lang.String xsdFilename,
java.lang.String xmlText)
throws SchemaValidationException
xsdFilename - The filename of the xml schema to validate againstxmlText - The text of an xml document to be validated
SchemaValidationException
public static void verify(java.lang.String xsdFilename)
throws SchemaValidationException
xsdFilename -
SchemaValidationException
public static void validate(java.lang.String xsdFilename,
java.io.File xmlFile)
throws SchemaValidationException
xsdFilename - The filename of the xml schema to validate againstxmlFile - The file to load XML from for validation
SchemaValidationExceptionpublic static void main(java.lang.String[] args)
args -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||