org.ow2.petals.component.framework.api.util
Interface XSLTUtil


public interface XSLTUtil

Author:
Frederic Gardes

Method Summary
 Transformer createTransformer(Hashtable<String,String> parameters, Source xsltSource)
          Create the transformer
 Transformer createTransformer(Source xsltSource)
          Create a transformer
 Document loadXML(String filename)
          Loads a W3C XML document from a file.
 Document transformDocument(Document xmlDocument, Hashtable<String,String> parameters, Source xsltSource)
          Applies a stylesheet (that receives parameters) to a given xml document.
 Document transformDocument(Document xmlDocument, Hashtable<String,String> parameters, String xsltFilename)
          Applies a stylesheet (that receives parameters) to a given xml document.
 Document transformDocument(Document xmlDocument, Source xsltSource)
          Applies a stylesheet to a given xml document.
 Document transformDocument(Document xmlDocument, String xsltFilename)
          Applies a stylesheet to a given xml document.
 Document transformDocument(Document xmlDocument, Transformer transformer)
          Use a transformer for a given xml document.
 String transformDocumentAsString(Document xmlDocument, Hashtable<String,String> parameters, Source xsltSource)
          Applies a stylesheet (that receives parameters) to a given xml document.
 String transformDocumentAsString(Document xmlDocument, Hashtable<String,String> parameters, String xsltFilename)
          Applies a stylesheet (that receives parameters) to a given xml document.
 String transformDocumentAsString(Document xmlDocument, Source xsltSource)
          Applies a stylesheet to a given xml document.
 String transformDocumentAsString(Document xmlDocument, String xsltFilename)
          Applies a stylesheet to a given xml document.
 

Method Detail

loadXML

Document loadXML(String filename)
                 throws IOException,
                        ParserConfigurationException,
                        SAXException
Loads a W3C XML document from a file.

Parameters:
filename - The name of the file to be loaded
Returns:
a document object model object representing the XML file
Throws:
IOException
ParserConfigurationException
SAXException

transformDocument

Document transformDocument(Document xmlDocument,
                           String xsltFilename)
                           throws TransformerException,
                                  ParserConfigurationException
Applies a stylesheet to a given xml document.

Parameters:
xmlDocument - the xml document to be transformed
xsltFilename - the filename of the stylesheet
Returns:
the transformed xml document
Throws:
ParserConfigurationException
TransformerException

transformDocument

Document transformDocument(Document xmlDocument,
                           Hashtable<String,String> parameters,
                           String xsltFilename)
                           throws TransformerException,
                                  ParserConfigurationException
Applies a stylesheet (that receives parameters) to a given xml document.

Parameters:
xmlDocument - the xml document to be transformed
parameters - the hashtable with the parameters to be passed to the stylesheet
xsltFilename - the filename of the stylesheet
Returns:
the transformed xml document
Throws:
ParserConfigurationException
TransformerException

transformDocumentAsString

String transformDocumentAsString(Document xmlDocument,
                                 Hashtable<String,String> parameters,
                                 String xsltFilename)
                                 throws TransformerFactoryConfigurationError,
                                        TransformerException
Applies a stylesheet (that receives parameters) to a given xml document. The resulting XML document is converted to a string after transformation. The order of the attributes of an element can't change between the stylesheet and the string generated.

Parameters:
xmlDocument - the xml document to be transformed
parameters - the hashtable with the parameters to be passed to the stylesheet
xsltFilename - the filename of the stylesheet
Returns:
the transformed xml document as a string
Throws:
TransformerException
TransformerFactoryConfigurationError

transformDocumentAsString

String transformDocumentAsString(Document xmlDocument,
                                 String xsltFilename)
                                 throws TransformerFactoryConfigurationError,
                                        TransformerException
Applies a stylesheet to a given xml document. The order of the attributes of an element can't change between the stylesheet and the string generated.

Parameters:
xmlDocument - the xml document to be transformed
xsltFilename - the filename of the stylesheet
Returns:
the transformed xml document
Throws:
TransformerException
TransformerFactoryConfigurationError

transformDocumentAsString

String transformDocumentAsString(Document xmlDocument,
                                 Source xsltSource)
                                 throws TransformerFactoryConfigurationError,
                                        TransformerException
Applies a stylesheet to a given xml document. The order of the attributes of an element can't change between the stylesheet and the string generated.

Parameters:
xmlDocument - the xml document to be transformed
xsltSource - the source of the stylesheet
Returns:
the transformed xml document
Throws:
TransformerException
TransformerFactoryConfigurationError

transformDocumentAsString

String transformDocumentAsString(Document xmlDocument,
                                 Hashtable<String,String> parameters,
                                 Source xsltSource)
                                 throws TransformerFactoryConfigurationError,
                                        TransformerException
Applies a stylesheet (that receives parameters) to a given xml document. The resulting XML document is converted to a string after transformation. The order of the attributes of an element can't change between the stylesheet and the string generated.

Parameters:
xmlDocument - the xml document to be transformed
parameters - the hashtable with the parameters to be passed to the stylesheet
xsltSource - the source of the stylesheet
Returns:
the transformed xml document as a string
Throws:
TransformerException
TransformerFactoryConfigurationError

transformDocument

Document transformDocument(Document xmlDocument,
                           Source xsltSource)
                           throws TransformerException,
                                  ParserConfigurationException
Applies a stylesheet to a given xml document.

Parameters:
xmlDocument - the xml document to be transformed
xsltSource - the source of the stylesheet
Returns:
the transformed xml document
Throws:
TransformerException
ParserConfigurationException

transformDocument

Document transformDocument(Document xmlDocument,
                           Hashtable<String,String> parameters,
                           Source xsltSource)
                           throws TransformerException,
                                  ParserConfigurationException
Applies a stylesheet (that receives parameters) to a given xml document.

Parameters:
xmlDocument - the xml document to be transformed
parameters - the hashtable with the parameters to be passed to the stylesheet
xsltSource - the source of the stylesheet
Returns:
the transformed xml document
Throws:
TransformerException
ParserConfigurationException

transformDocument

Document transformDocument(Document xmlDocument,
                           Transformer transformer)
                           throws TransformerException,
                                  ParserConfigurationException
Use a transformer for a given xml document.

Parameters:
xmlDocument - the xml document to be transformed
transformer - the transformer created with the stylesheet
Returns:
the transformed xml document
Throws:
TransformerException
ParserConfigurationException

createTransformer

Transformer createTransformer(Hashtable<String,String> parameters,
                              Source xsltSource)
                              throws TransformerFactoryConfigurationError,
                                     TransformerException
Create the transformer

Parameters:
parameters - the hashtable with the parameters to be passed to the stylesheet
xsltSource - the source of the stylesheet
Returns:
the transformer
Throws:
TransformerFactoryConfigurationError
TransformerException

createTransformer

Transformer createTransformer(Source xsltSource)
                              throws TransformerFactoryConfigurationError,
                                     TransformerException
Create a transformer

Parameters:
xsltSource - the source of the stylesheet
Returns:
the transformer
Throws:
TransformerFactoryConfigurationError
TransformerException


Copyright © 2005-2012 Petals Link (EBM Websourcing). All Rights Reserved.