| org.apache.cocoon.components.validation.Validator
All known Subclasses: org.apache.cocoon.components.validation.impl.AbstractValidator,
Validator | public interface Validator (Code) | | The
Validator interface provides the abstraction of a component able
to validate XML documents using schemas defined in different languages.
This is basically the main entry point of the validation API, allowing users
to transparently access validators (in the form of
ValidationHandler s
receiving SAX events for the documents to be validated), in different grammar
languages, using different implementations.
As more than one
SchemaParser might be able to parse and create
Schema instances for a particular grammar language, this interface
defines a unique lookup method to allow selection of a particular
SchemaParser implementation.
Assuming that two different
SchemaParser s called first
and second are both able to understand the
Validator.GRAMMAR_RELAX_NG RELAX NG grammar (identified by the
http://relaxng.org/ns/structure/1.0 identifier) one could select
between the two implementation using the following two strings:
first:http://relaxng.org/ns/structure/1.0
second:http://relaxng.org/ns/structure/1.0
As a rule (unless when this is impossible) the grammar identifier is
equivalent to the namespace of the root element of a schema.
|
Method Summary | |
public ValidationHandler | getValidationHandler(String uri) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, and each error or warning occurring while
validating the document will trigger a
SAXException to be thrown back
to the caller.
Parameters: uri - the location of the schema to use to validate the document. | public ValidationHandler | getValidationHandler(String uri, String grammar) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each error or warning occurring while validating the document will trigger
a
SAXException to be thrown back to the caller.
Parameters: uri - the location of the schema to use to validate the document. Parameters: grammar - the grammar language of the schema to parse. | public ValidationHandler | getValidationHandler(String uri, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, while each validation error or warning will
be passed to the specified
ErrorHandler which will have the ability
to generate and throw a
SAXException back to the caller.
Parameters: uri - the location of the schema to use to validate the document. Parameters: errorHandler - the ErrorHandler notified of validation problems. | public ValidationHandler | getValidationHandler(String uri, String grammar, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each validation error or warning will be passed to the specified
ErrorHandler which will have the ability to generate and throw a
SAXException back to the caller.
Parameters: uri - the location of the schema to use to validate the document. Parameters: grammar - the grammar language of the schema to parse. Parameters: errorHandler - the ErrorHandler notified of validation problems. | public ValidationHandler | getValidationHandler(Source source) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, and each error or warning occurring while
validating the document will trigger a
SAXException to be thrown back
to the caller.
Parameters: source - the Source identifying the schema to use for validation. | public ValidationHandler | getValidationHandler(Source source, String grammar) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each error or warning occurring while validating the document will trigger
a
SAXException to be thrown back to the caller.
Parameters: source - the Source identifying the schema to use for validation. Parameters: grammar - the grammar language of the schema to parse. | public ValidationHandler | getValidationHandler(Source source, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, while each validation error or warning will
be passed to the specified
ErrorHandler which will have the ability
to generate and throw a
SAXException back to the caller.
Parameters: source - the Source identifying the schema to use for validation. Parameters: errorHandler - the ErrorHandler notified of validation problems. | public ValidationHandler | getValidationHandler(Source source, String grammar, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each validation error or warning will be passed to the specified
ErrorHandler which will have the ability to generate and throw a
SAXException back to the caller.
Parameters: source - the Source identifying the schema to use for validation. Parameters: grammar - the grammar language of the schema to parse. Parameters: errorHandler - the ErrorHandler notified of validation problems. |
GRAMMAR_TREX | final public static String GRAMMAR_TREX(Code) | | The Trex grammar identifer.
|
|
|