com.saxonica
Class SchemaAwareTransformerFactory

java.lang.Object
  extended by javax.xml.transform.TransformerFactory
      extended by javax.xml.transform.sax.SAXTransformerFactory
          extended by net.sf.saxon.TransformerFactoryImpl
              extended by com.saxonica.SchemaAwareTransformerFactory

public class SchemaAwareTransformerFactory
extends TransformerFactoryImpl

The is the JAXP TransformerFactory implementation for the schema-aware version of Saxon. It can be invoked by setting the system property java.xml.transform.TransformerFactory to the value com.saxonica.SchemaAwareTransformerFactory, and calling TransformerFactory.newInstance(), or it can be instantiated directly.


Field Summary
 
Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory
FEATURE, FEATURE_XMLFILTER
 
Constructor Summary
SchemaAwareTransformerFactory()
          Create a SchemaAwareTransformerFactory.
SchemaAwareTransformerFactory(Configuration config)
          Construct a TransformerFactory using an existing Configuration.
 
Method Summary
 void addSchema(Source schemaSource)
          Load a schema, which will be available for use by all subsequent operations using this TransformerFactory.
 
Methods inherited from class net.sf.saxon.TransformerFactoryImpl
getAssociatedStylesheet, getAttribute, getConfiguration, getErrorListener, getFeature, getURIResolver, newTemplates, newTemplates, newTemplatesHandler, newTransformer, newTransformer, newTransformerHandler, newTransformerHandler, newTransformerHandler, newXMLFilter, newXMLFilter, setAttribute, setConfiguration, setErrorListener, setFeature, setURIResolver
 
Methods inherited from class javax.xml.transform.TransformerFactory
newInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaAwareTransformerFactory

public SchemaAwareTransformerFactory()
Create a SchemaAwareTransformerFactory. A SchemaAwareConfiguration will be created automatically.


SchemaAwareTransformerFactory

public SchemaAwareTransformerFactory(Configuration config)
Construct a TransformerFactory using an existing Configuration.

Parameters:
config - the configuration to be used. This must be a SchemaAwareConfiguration.
Throws:
ClassCastException - if the supplied configuration is not schema-aware.
Method Detail

addSchema

public void addSchema(Source schemaSource)
               throws TransformerException
Load a schema, which will be available for use by all subsequent operations using this TransformerFactory.

Parameters:
schemaSource - the JAXP Source object identifying the schema document to be loaded
Throws:
TransformerException - if the schema cannot be read or parsed or if it is invalid


Copyright (C) Michael H. Kay. All rights reserved.