Top Description Constructors Methods
org.jdom2.input.sax

public Class XMLReaderSchemaFactory

extends AbstractReaderSchemaFactory
Class Inheritance
Imports
javax.xml.parsers.SAXParserFactory, javax.xml.validation.Schema

This XMLReaderJDOMFactory class returns XMLReaders configured to validate against the supplied Schema instance. The Schema could be an XSD schema or some other schema supported by SAX (e.g. RelaxNG). The SAX Parser is obtained through the JAXP process.

If you want to validate an XML document against the XSD references embedded in the XML itself (xsdSchemaLocation) then you do not want to use this class but rather use an alternate means like XMLReaders#XSDVALIDATING.

See the package documentation for the best alternatives.

Author
Rolf Lear
See Also
org.jdom2.input.sax

Constructor Summary

AccessConstructor and Description
public
XMLReaderSchemaFactory(final Schema
The Schema to use for validation.
schema
)

XMLReader instances from this class will be configured to validate using the supplied Schema instance.

public
XMLReaderSchemaFactory(final String
The name of the SAXParserFactory class to use
factoryClassName
,
final ClassLoader
The classLoader to use for loading the SAXParserFactory.
classloader
,
final Schema
The Schema to use for validation.
schema
)

XMLReader instances from this class will be configured to validate using the supplied Schema instance, and use the specified JAXP SAXParserFactory.

Method Summary

Inherited from org.jdom2.input.sax.AbstractReaderSchemaFactory:
createXMLReaderisValidating

Constructor Detail

XMLReaderSchemaFactoryback to summary
public XMLReaderSchemaFactory(final Schema schema)

XMLReader instances from this class will be configured to validate using the supplied Schema instance.

Parameters
schema:Schema

The Schema to use for validation.

XMLReaderSchemaFactoryback to summary
public XMLReaderSchemaFactory(final String factoryClassName, final ClassLoader classloader, final Schema schema)

XMLReader instances from this class will be configured to validate using the supplied Schema instance, and use the specified JAXP SAXParserFactory.

Parameters
factoryClassName:String

The name of the SAXParserFactory class to use

classloader:ClassLoader

The classLoader to use for loading the SAXParserFactory.

schema:Schema

The Schema to use for validation.

Since
2.0.3