com.xml_project.morganaxproc.connectors
Interface XSLTTemplate


public interface XSLTTemplate

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:


Method Summary
 void clearParameter()
          Ensures that all previously set parameters are cleared.
 void setCollectionURIResolver(CollectionURIResolver resolver)
          Sets the resolver to use for fn:collection in transformation.
 void setDefaultCollection(nu.xom.Document[] defaultCollection)
          Set the default collection for the transformation, i.e. the sequence of documents on port "source" of p:xslt.
 void setErrorListener(javax.xml.transform.ErrorListener listener)
          Sets the error listener to use in transformation.
 void setOutputBaseURI(java.lang.String uri)
          Sets the output base uri supplied from p:xslt.
 void setParameter(javax.xml.namespace.QName name, XdmSequence value)
          Sets the parameters on port 'parameters' of p:xslt.
 void setTextURIResolver(TextURIResolver resolver)
          Sets the uri resolver to use for fn:unparsedText in XSLT 2.0 transformations.
 void setURIResolver(javax.xml.transform.URIResolver resolver)
          Sets the uri resolver to use for fn:document in transformation.
 XsltResult transform(nu.xom.Document sourceDocument, java.lang.String outputBaseURI, javax.xml.namespace.QName initialTemplate, javax.xml.namespace.QName initialMode)
          Starts a transformation using this template
 

Method Detail

transform

XsltResult transform(nu.xom.Document sourceDocument,
                     java.lang.String outputBaseURI,
                     javax.xml.namespace.QName initialTemplate,
                     javax.xml.namespace.QName initialMode)
                     throws javax.xml.transform.TransformerException
Starts a transformation using this template

Parameters:
sourceDocument - - the document to transform or null.
outputBaseURI - - the output base uri or null.
initialTemplate - the name of the initial template for the transformation or null.
initialMode - initialMode the initial mode to use or null.
Returns:
the result of the transformation
Throws:
javax.xml.transform.TransformerException

setURIResolver

void setURIResolver(javax.xml.transform.URIResolver resolver)
Sets the uri resolver to use for fn:document in transformation.

Parameters:
resolver - the uri resolver to use.

setCollectionURIResolver

void setCollectionURIResolver(CollectionURIResolver resolver)
Sets the resolver to use for fn:collection in transformation.

Parameters:
resolver - the uri resolver to use.

setTextURIResolver

void setTextURIResolver(TextURIResolver resolver)
Sets the uri resolver to use for fn:unparsedText in XSLT 2.0 transformations.

Parameters:
resolver - the uri resolver to use.

setErrorListener

void setErrorListener(javax.xml.transform.ErrorListener listener)
Sets the error listener to use in transformation.

Parameters:
listener - the error listener to use.

setOutputBaseURI

void setOutputBaseURI(java.lang.String uri)
Sets the output base uri supplied from p:xslt. This method can be empty if a connector for an XSLT 1.0 processor is developed.

Parameters:
uri - base output base uri as supplied to p:xslt.

setDefaultCollection

void setDefaultCollection(nu.xom.Document[] defaultCollection)
Set the default collection for the transformation, i.e. the sequence of documents on port "source" of p:xslt. This method can be empty if a connector for an XSLT 1.0 processor is developed.

Parameters:
defaultCollection - the documents on port "source" of p:xslt as Source array.

clearParameter

void clearParameter()
Ensures that all previously set parameters are cleared.


setParameter

void setParameter(javax.xml.namespace.QName name,
                  XdmSequence value)
Sets the parameters on port 'parameters' of p:xslt.

Parameters:
name - the name of the parameter to set.
value - the value of the parameter.