|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.excalibur.xml.xslt.XSLTProcessorImpl
Nested Class Summary |
Nested classes inherited from class org.apache.excalibur.xml.xslt.XSLTProcessor |
XSLTProcessor.TransformerHandlerAndValidity |
Field Summary | |
protected boolean |
m_checkIncludes
Check included stylesheets |
protected javax.xml.transform.sax.SAXTransformerFactory |
m_defaultFactory
The default TransformerFactory used by this component |
protected org.apache.excalibur.xml.xslt.TraxErrorHandler |
m_errorHandler
The error handler for the transformer |
protected javax.xml.transform.sax.SAXTransformerFactory |
m_factory
The trax TransformerFactory this component uses |
protected java.util.Map |
m_includesMap
Map of pairs of System ID's / validities of the included stylesheets |
protected boolean |
m_incrementalProcessing
Is incremental processing turned on? (default for Xalan: no) |
protected ServiceManager |
m_manager
The ServiceManager |
protected SourceResolver |
m_resolver
Resolver used to resolve XSLT document() calls, imports and includes |
protected Store |
m_store
The store service instance |
protected java.lang.String |
m_transformerFactory
The configured transformer factory to use |
protected boolean |
m_useStore
Is the store turned on? (default is off) |
protected XMLizer |
m_xmlizer
|
Fields inherited from interface org.apache.excalibur.xml.xslt.XSLTProcessor |
ROLE |
Constructor Summary | |
XSLTProcessorImpl()
|
Method Summary | |
void |
dispose()
Disposable |
javax.xml.transform.sax.TransformerHandler |
getTransformerHandler(Source stylesheet)
Same as getTransformerHandler(Source,XMLFilter) , with
filter set to null . |
javax.xml.transform.sax.TransformerHandler |
getTransformerHandler(Source stylesheet,
org.xml.sax.XMLFilter filter)
Return a TransformerHandler for a given
stylesheet Source . |
XSLTProcessor.TransformerHandlerAndValidity |
getTransformerHandlerAndValidity(Source stylesheet)
Same as getTransformerHandlerAndValidity(Source,XMLFilter) , with
filter set to null . |
XSLTProcessor.TransformerHandlerAndValidity |
getTransformerHandlerAndValidity(Source stylesheet,
org.xml.sax.XMLFilter filter)
Return a TransformerHandler and
SourceValidity for a given stylesheet
Source . |
void |
initialize()
Initialize |
void |
parameterize(Parameters params)
Configure the component |
void |
recycle()
Recycle the component |
javax.xml.transform.Source |
resolve(java.lang.String href,
java.lang.String base)
Called by the processor when it encounters an xsl:include, xsl:import, or document() function. |
void |
service(ServiceManager manager)
Compose. |
void |
setTransformerFactory(java.lang.String classname)
Set the transformer factory used by this component |
void |
transform(Source source,
Source stylesheet,
Parameters params,
javax.xml.transform.Result result)
Applies an XSLT stylesheet to an XML document. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Store m_store
protected java.lang.String m_transformerFactory
protected javax.xml.transform.sax.SAXTransformerFactory m_factory
protected javax.xml.transform.sax.SAXTransformerFactory m_defaultFactory
protected boolean m_useStore
protected boolean m_incrementalProcessing
protected SourceResolver m_resolver
protected org.apache.excalibur.xml.xslt.TraxErrorHandler m_errorHandler
protected boolean m_checkIncludes
protected java.util.Map m_includesMap
protected XMLizer m_xmlizer
protected ServiceManager m_manager
Constructor Detail |
public XSLTProcessorImpl()
Method Detail |
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
manager
- The ServiceManager
which this
Serviceable
uses. Must not be null
.
ServiceException
- if an error occurspublic void initialize() throws java.lang.Exception
initialize
in interface Initializable
java.lang.Exception
- if an error occurspublic void dispose()
dispose
in interface Disposable
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
params
- the parameters. Must not be null
.
ParameterException
- if parameters are invalidpublic void setTransformerFactory(java.lang.String classname)
setTransformerFactory
in interface XSLTProcessor
classname
- the name of the class implementing
TransformerFactory
value. If an error is found
or the indicated class doesn't implement the required interface
the original factory of the component is maintained.public javax.xml.transform.sax.TransformerHandler getTransformerHandler(Source stylesheet) throws XSLTProcessorException
XSLTProcessor
XSLTProcessor.getTransformerHandler(Source,XMLFilter)
, with
filter
set to null
.
getTransformerHandler
in interface XSLTProcessor
stylesheet
- a Source
value
TransformerHandler
value
XSLTProcessorException
- if an error occursXSLTProcessor.getTransformerHandler(org.apache.excalibur.source.Source)
public javax.xml.transform.sax.TransformerHandler getTransformerHandler(Source stylesheet, org.xml.sax.XMLFilter filter) throws XSLTProcessorException
XSLTProcessor
Return a TransformerHandler
for a given
stylesheet Source
. This can be used in a pipeline to
handle the transformation of a stream of SAX events. See org.apache.cocoon.transformation.TraxTransformer#setConsumer
for
an example of how to use this method.
The additional filter
argument, if it's not
null
, is inserted in the chain SAX events as an XML
filter during the parsing or the source document.
This method caches the Templates object with meta information (modification time and list of included stylesheets) and performs a reparsing only if this changes.
getTransformerHandler
in interface XSLTProcessor
stylesheet
- a Source
valuefilter
- a XMLFilter
value
TransformerHandler
value
XSLTProcessorException
- if an error occursXSLTProcessor.getTransformerHandler(org.apache.excalibur.source.Source, org.xml.sax.XMLFilter)
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet) throws XSLTProcessorException
XSLTProcessor
XSLTProcessor.getTransformerHandlerAndValidity(Source,XMLFilter)
, with
filter
set to null
.
getTransformerHandlerAndValidity
in interface XSLTProcessor
stylesheet
- a Source
value
XSLTProcessor.TransformerHandlerAndValidity
value
XSLTProcessorException
- if an error occurspublic XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet, org.xml.sax.XMLFilter filter) throws XSLTProcessorException
XSLTProcessor
Return a TransformerHandler
and
SourceValidity
for a given stylesheet
Source
. This can be used in a pipeline to
handle the transformation of a stream of SAX events. See org.apache.cocoon.transformation.TraxTransformer#setConsumer
for
an example of how to use this method.
The additional filter
argument, if it's not
null
, is inserted in the chain SAX events as an XML
filter during the parsing or the source document.
This method caches the Templates object with meta information (modification time and list of included stylesheets) and performs a reparsing only if this changes.
getTransformerHandlerAndValidity
in interface XSLTProcessor
stylesheet
- a Source
valuefilter
- a XMLFilter
value
TransformerHandlerAndValidity
value
XSLTProcessorException
- if an error occurspublic void transform(Source source, Source stylesheet, Parameters params, javax.xml.transform.Result result) throws XSLTProcessorException
XSLTProcessor
Source
objects. The result of the transformation is placed in
Result
, which should be properly initialized before
invoking this method. Any additional parameters passed in
params
will become arguments to the stylesheet.
transform
in interface XSLTProcessor
source
- a Source
valuestylesheet
- a Source
valueparams
- a Parameters
valueresult
- a Result
value
XSLTProcessorException
- if an error occurspublic javax.xml.transform.Source resolve(java.lang.String href, java.lang.String base) throws javax.xml.transform.TransformerException
resolve
in interface javax.xml.transform.URIResolver
href
- An href attribute, which may be relative or absolute.base
- The base URI in effect when the href attribute
was encountered.
javax.xml.transform.TransformerException
- if an error occurs when trying to
resolve the URI.public void recycle()
recycle
in interface Recyclable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |