com.jclark.xsl.trax
public class TransformerFactoryImpl extends SAXTransformerFactory
import java.io.*;
import javax.xml.transform.*;
...
System.setProperty("javax.xml.transform.TransformerFactory",
"jd.xml.xslt.trax.TransformerFactoryImpl");
TransformerFactory tfactory = TransformerFactory.newInstance();
Source stylesheetSource = ...
Transformer transformer = tfactory.newTransformer(stylesheetSource);
transformer.transform(...);
Method Summary | |
---|---|
Source | getAssociatedStylesheet(Source source, String media, String title, String charset)
Get the stylesheet specification(s) associated
via the xml-stylesheet processing instruction (see
http://www.w3.org/TR/xml-stylesheet/) with the document
document specified in the source parameter, and that match
the given criteria. |
Object | getAttribute(String name)
Throws an IllegalArgumentException since attributes are not supported. |
ErrorListener | getErrorListener()
Get the error event handler for the TransformerFactory. |
boolean | getFeature(String name)
Look up the value of a feature.
|
XMLReader | getReader(Source source) |
URIResolver | getURIResolver()
Return the URIResolver that was set with setURIResolver.
the object that is used by default during the
transformation to resolve URIs used in document(),
xsl:import, or xsl:include. |
Templates | newTemplates(Source source)
Process the Source into a Templates object, which is a
a compiled representation of the source. |
TemplatesHandler | newTemplatesHandler()
Get a TemplatesHandler object that can process SAX ContentHandler events into a
Templates object. |
Transformer | newTransformer(Source source)
Process the Source into a Transformer object. |
Transformer | newTransformer()
Create a new Transformer object that performs a copy
of the source to the result. |
TransformerHandler | newTransformerHandler() |
TransformerHandler | newTransformerHandler(Source source) |
TransformerHandler | newTransformerHandler(Templates templates) |
XMLFilter | newXMLFilter(Source source) |
XMLFilter | newXMLFilter(Templates templates) |
void | setAttribute(String name, Object value)
Throws an IllegalArgumentException since attributes are not supported. |
void | setErrorListener(ErrorListener listener)
Set the error event listener for the TransformerFactory, which
is used for the processing of transformation instructions, |
void | setFeature(String name, boolean value) |
void | setURIResolver(URIResolver uriResolver)
Set the URIResolver. |
Parameters: source The XML source document. media The media attribute to be matched. May be null, in which case the prefered templates will be used (i.e. alternate = no). title The value of the title attribute to match. May be null. charset The value of the charset attribute to match. May be null.
Returns: A Source object suitable for passing to the TransformerFactory.
Throws: TransformerConfigurationException.
Returns: The current error handler, which should never be null.
The feature name is any absolute URI.
Parameters: name The feature name, which is an absolute URI.
Returns: The current state of the feature (true or false).
Returns: A non-null reference to a TemplatesHandler, that may be used as a ContentHandler for SAX parse events.
Throws: TransformerConfigurationException - If for some reason the TemplatesHandler cannot be created.
Returns: A Transformer object that may be used to perform a transformation in a single thread, never null.
Throws: TransformerConfigurationException May throw this during the parse when it is constructing the Templates object and fails.