|
|||||||||
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 String |
EXECUTION_TERMINATED
Error code for user terminated transformation. |
static String |
FEATURE_NOT_AVAILABLE
Error code for a feature not supported by the connector or the underlying processor. |
static 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 String |
getInfoString()
Defines a string displayed on the standard output stream the first time, an instance of the connector is generated. |
abstract String |
getShortInfo()
Defines a string to be used in TestReporter |
abstract boolean |
implementsVersion(String version)
Checks whether the XSLT processor used in this connector supports a specific version of XSLT. |
abstract List<XPathFunction> |
importXPathFunctions(nu.xom.Document template)
Compile an xslt stylesheet and makes all XPath functions available as result. |
static XSLTConnector |
newInstance(String className,
PrintWriter infoWriter)
Creates a new instance of an XSLTConnector using the given class name. |
static XSLTConnector |
newInstance(XProcConfiguration config,
PrintWriter infoWriter)
Creates a new instance of an XSLTConnector using the class defined in XProcConfiguration . |
abstract void |
setErrorListener(ErrorListener listener)
Sets the error listener for compilation. |
abstract void |
setImportURIResolver(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 String UNKNOWN_INITIAL_TEMPLATE_OR_MODE
public static final String EXECUTION_TERMINATED
public static final String FEATURE_NOT_AVAILABLE
Constructor Detail |
---|
public XSLTConnector()
Method Detail |
---|
public abstract String getInfoString()
public abstract String getShortInfo()
TestReporter
public abstract boolean implementsVersion(String version)
version
- the requested version
true
if this version is supported, otherwise false
public abstract void setErrorListener(ErrorListener listener)
listener
- the error listener for compilation.public abstract void setImportURIResolver(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 TransformerException
template
template
- the stylesheet
TransformerException
- if any error occurs during compilationpublic abstract List<XPathFunction> importXPathFunctions(nu.xom.Document template) throws TransformerException
template
- the stylesheet
TransformerException
- if any error occurs during compilation or import is not supported.public static final XSLTConnector newInstance(XProcConfiguration config, PrintWriter infoWriter) throws 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
TransformerFactoryConfigurationError
- if any exception occurs in creating the new XSLTConnector
.public static final XSLTConnector newInstance(String className, PrintWriter infoWriter) throws TransformerFactoryConfigurationError
MorganaXProc
.
className
- the class name for the new connector.infoWriter
- the PrintWriter
for messages or null
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 |