org.activemath.xsl
Interface Stylesheets

All Known Implementing Classes:
JaxpProcessor, Processor, SaxonProcessor

public interface Stylesheets

Interface Stylesheets

An Interface to provide functionalities for centrally processing stylesheet transformations including URI resolving facilities.

Version:
1.0

Method Summary
 String getBaseURI()
          get the baseURI stylesheets can be relative to
 Templates loadTemplate(String stylesheet)
          get a template for the given stylesheet if the wanted one already exists then return this one else create a new one an return it
 void loadTemplateAsync(String stylesheet)
          Loads a template asynchronously.
 void setBaseURI(String base)
          set the baseURI stylesheets can be relative to
 void transform(org.jdom.Document document, OutputStream outStream, String stylesheet, Hashtable params)
          transform a JDOM document by the given Stylesheet
 void transform(org.jdom.Document document, Result result, String stylesheet, Hashtable params)
          transform a JDOM document by the given Stylesheet
 void transform(org.jdom.Document document, Writer writer, String stylesheet, Hashtable params)
          transform a JDOM document by the given Stylesheet
 void transform(InputStream inStream, OutputStream outStream, String stylesheet, Hashtable params)
          Deprecated. use transform(new StreamSource(inStream), new StreamResult(outStream), stylesheet, params) instead
 void transform(Source inputSource, Result outputResult, String stylesheet, Hashtable params)
          transform a xml document by the given Stylesheet
 

Method Detail

setBaseURI

void setBaseURI(String base)
                throws MalformedURLException
set the baseURI stylesheets can be relative to

Parameters:
base - the URI to set the baseURI to
Throws:
MalformedURLException - if the baseURI is not a valid URL

getBaseURI

String getBaseURI()
get the baseURI stylesheets can be relative to

Returns:
the base URI - may be null if the baseURI isn't set yet.

loadTemplate

Templates loadTemplate(String stylesheet)
                       throws TransformerException
get a template for the given stylesheet

if the wanted one already exists then return this one else create a new one an return it

Parameters:
stylesheet - the URI of the stylesheet to use for loading (may be absolute or relative to the baseURI)
Returns:
the template for the given stylesheet
Throws:
TransformerException - if a new template can't be created for the given stylesheet or a URI can't be resolved

loadTemplateAsync

void loadTemplateAsync(String stylesheet)
Loads a template asynchronously. The processor object (the Stylesheets object) has to wait for the load to be complete before applying the transformation to the named stylesheet.


transform

void transform(org.jdom.Document document,
               Result result,
               String stylesheet,
               Hashtable params)
               throws TransformerException
transform a JDOM document by the given Stylesheet

Parameters:
document - the JDOM document to transform
result - the Result of the transformation (that means: the transformed document)
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - if the transformation fails

transform

void transform(org.jdom.Document document,
               OutputStream outStream,
               String stylesheet,
               Hashtable params)
               throws TransformerException
transform a JDOM document by the given Stylesheet

Parameters:
document - the JDOM document to transform
outStream - the resultingOutputStream of the transformation
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - if the transformation fails

transform

void transform(org.jdom.Document document,
               Writer writer,
               String stylesheet,
               Hashtable params)
               throws TransformerException
transform a JDOM document by the given Stylesheet

Parameters:
document - the JDOM document to transform
outStream - the resultingWriter of the transformation
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - if the transformation fails

transform

void transform(Source inputSource,
               Result outputResult,
               String stylesheet,
               Hashtable params)
               throws TransformerException
transform a xml document by the given Stylesheet

Parameters:
inputSource - the Source of the xml document to transform
outputResult - the Result of the transformation (that means: the transformed document)
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - if the transformation fails

transform

void transform(InputStream inStream,
               OutputStream outStream,
               String stylesheet,
               Hashtable params)
               throws TransformerException
Deprecated. use transform(new StreamSource(inStream), new StreamResult(outStream), stylesheet, params) instead

transform a xml document by the given Stylesheet

Parameters:
inStream - the InputStream of the xml document to transform
outStream - the resultingOutputStream of the transformation
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - if the transformation fails