SAXParserFactory.Schema Property

Definition

Gets the Schema object specified through the #setSchema(Schema schema) method. -or- Set the Schema to be used by parsers created from this factory.

public virtual Javax.Xml.Validation.Schema? Schema { [Android.Runtime.Register("getSchema", "()Ljavax/xml/validation/Schema;", "GetGetSchemaHandler")] get; [Android.Runtime.Register("setSchema", "(Ljavax/xml/validation/Schema;)V", "GetSetSchema_Ljavax_xml_validation_Schema_Handler")] set; }
[<get: Android.Runtime.Register("getSchema", "()Ljavax/xml/validation/Schema;", "GetGetSchemaHandler")>]
[<set: Android.Runtime.Register("setSchema", "(Ljavax/xml/validation/Schema;)V", "GetSetSchema_Ljavax_xml_validation_Schema_Handler")>]
member this.Schema : Javax.Xml.Validation.Schema with get, set

Property Value

the Schema object that was last set through the #setSchema(Schema) method, or null if the method was not invoked since a SAXParserFactory is created.

Attributes

Exceptions

For backward compatibility, when implementations for earlier versions of JAXP is used, this exception will be thrown.

Remarks

Property getter documentation:

Gets the Schema object specified through the #setSchema(Schema schema) method.

Added in 1.5.

Java documentation for javax.xml.parsers.SAXParserFactory.getSchema().

Property setter documentation:

Set the Schema to be used by parsers created from this factory.

When a Schema is non-null, a parser will use a validator created from it to validate documents before it passes information down to the application.

When warnings/errors/fatal errors are found by the validator, the parser must handle them as if those errors were found by the parser itself. In other words, if the user-specified org.xml.sax.ErrorHandler is set, it must receive those errors, and if not, they must be treated according to the implementation specific default error handling rules.

A validator may modify the SAX event stream (for example by adding default values that were missing in documents), and a parser is responsible to make sure that the application will receive those modified event stream.

Initially, null is set as the Schema.

This processing will take effect even if the #isValidating() method returns false.

It is an error to use the http://java.sun.com/xml/jaxp/properties/schemaSource property and/or the http://java.sun.com/xml/jaxp/properties/schemaLanguage property in conjunction with a non-null Schema object. Such configuration will cause a SAXException exception when those properties are set on a SAXParser.

<h4>Note for implementors</h4>

A parser must be able to work with any Schema implementation. However, parsers and schemas are allowed to use implementation-specific custom mechanisms as long as they yield the result described in the specification.

Added in 1.5.

Java documentation for javax.xml.parsers.SAXParserFactory.setSchema(javax.xml.validation.Schema).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to