|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.connectors.XSLTConnector
public abstract class XSLTConnector
This class defines an interface for the use of XSLT processors with MorganaXProc
. It
allows you to use any XSLT processor you like in 'p:xslt' by just wrapping an
XSLTConnector
around it.
The interface to XSLT processors comes in two classes:
XSLTConnector
serves as the basic connection to the used
XSLT processor. It holds the basic information of the connector and
is used to set some configuration. The basis task of XSLTConnector
is to create an instance of XSLTTemplate
as an executable form
of an XSLT stylesheet. in compile()
.
XSLTTemplate
is then used to set the dynamic context of
the transformation and run it to produce a result document.
Field Summary | |
---|---|
static java.lang.String |
EXECUTION_TERMINATED
Error code for user terminated transformation. |
static java.lang.String |
FEATURE_NOT_AVAILABLE
Error code for a feature not supported by the connector or the underlying processor. |
static java.lang.String |
UNKNOWN_INITIAL_TEMPLATE_OR_MODE
Error code for an unknown initial template or mode. |
Constructor Summary | |
---|---|
XSLTConnector()
|
Method Summary | |
---|---|
abstract void |
addXPathFunction(XPathFunction function)
Adds an user written XPath extension function to the list of visible functions in XSLT |
abstract XSLTTemplate |
compile(nu.xom.Document template)
Creates an executable form a the template |
abstract java.lang.String |
getInfoString()
Defines a string displayed on the standard output stream the first time, an instance of the connector is generated. |
abstract java.lang.String |
getShortInfo()
Defines a string to be used in TestReporter |
abstract boolean |
implementsVersion(java.lang.String version)
Checks whether the XSLT processor used in this connector supports a specific version of XSLT. |
abstract java.util.List<XPathFunction> |
importXPathFunctions(nu.xom.Document template)
Compile an xslt stylesheet and makes all XPath functions available as result. |
static XSLTConnector |
newInstance(java.lang.String className,
java.io.PrintWriter infoWriter,
java.io.PrintStream messageStream)
Creates a new instance of an XSLTConnector using the given class name. |
static XSLTConnector |
newInstance(XProcConfiguration config,
java.io.PrintWriter infoWriter,
java.io.PrintStream messageStream)
Creates a new instance of an XSLTConnector using the class defined in XProcConfiguration . |
abstract void |
setErrorListener(javax.xml.transform.ErrorListener listener)
Sets the error listener for compilation. |
abstract void |
setImportURIResolver(javax.xml.transform.URIResolver resolver)
Sets uri resolver to resolve stylesheet import with xsl:import and xsl:include. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UNKNOWN_INITIAL_TEMPLATE_OR_MODE
public static final java.lang.String EXECUTION_TERMINATED
public static final java.lang.String FEATURE_NOT_AVAILABLE
Constructor Detail |
---|
public XSLTConnector()
Method Detail |
---|
public abstract java.lang.String getInfoString()
public abstract java.lang.String getShortInfo()
TestReporter
public abstract boolean implementsVersion(java.lang.String version)
version
- the requested version
true
if this version is supported, otherwise false
public abstract void setErrorListener(javax.xml.transform.ErrorListener listener)
listener
- the error listener for compilation.public abstract void setImportURIResolver(javax.xml.transform.URIResolver resolver)
resolver
- the URIResolver
to be used by MorganaXProc
.public abstract void addXPathFunction(XPathFunction function) throws XPathException
function
- the function to add.
XPathException
- if the function cannot be casted.public abstract XSLTTemplate compile(nu.xom.Document template) throws javax.xml.transform.TransformerException
template
template
- the stylesheet
javax.xml.transform.TransformerException
- if any error occurs during compilationpublic abstract java.util.List<XPathFunction> importXPathFunctions(nu.xom.Document template) throws javax.xml.transform.TransformerException
template
- the stylesheet
javax.xml.transform.TransformerException
- if any error occurs during compilation or import is not supported.public static final XSLTConnector newInstance(XProcConfiguration config, java.io.PrintWriter infoWriter, java.io.PrintStream messageStream) throws javax.xml.transform.TransformerFactoryConfigurationError
XProcConfiguration
.
This method is called before the execution of the pipeline by MorganaXProc
.
config
- the XProcConfiguration to use.infoWriter
- the PrintWriter
for messages or null
messageStream
- the PrintStream
for copyright messages.
javax.xml.transform.TransformerFactoryConfigurationError
- if any exception occurs in creating the new XSLTConnector
.public static final XSLTConnector newInstance(java.lang.String className, java.io.PrintWriter infoWriter, java.io.PrintStream messageStream) throws javax.xml.transform.TransformerFactoryConfigurationError
MorganaXProc
.
className
- the class name for the new connector.infoWriter
- the PrintWriter
for messages or null
messageStream
- the PrintStream
for copyright messages.
javax.xml.transform.TransformerFactoryConfigurationError
- if any exception occurs in creating the new XSLTConnector
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |