nl.gx.webmanager.handler.util
Class XSLTransformer

java.lang.Object
  extended by nl.gx.webmanager.handler.util.XSLTransformer

public class XSLTransformer
extends java.lang.Object

Apply a transformation from a source, populating a result. Transformers may be reused, but not concurrently

See Also:
Transformer

Constructor Summary
XSLTransformer(boolean namespaceAware, boolean validating)
          Constructs a new xsl transformer.
 
Method Summary
 void transform(java.lang.String stylesheet, java.io.Reader input, java.io.Writer output)
          Executes an xsl transformation.
 java.lang.String transform(java.lang.String stylesheet, java.lang.String xml)
          Executes an xsl transformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTransformer

public XSLTransformer(boolean namespaceAware,
                      boolean validating)
Constructs a new xsl transformer.

Parameters:
namespaceAware - Indicates whether the used sax parser should be namespace aware.
validating - Indicates whether the used sax parser should be validating.
Method Detail

transform

public java.lang.String transform(java.lang.String stylesheet,
                                  java.lang.String xml)
                           throws javax.xml.parsers.ParserConfigurationException,
                                  javax.xml.transform.TransformerException,
                                  org.xml.sax.SAXException
Executes an xsl transformation.

Parameters:
stylesheet - The xsl
xml - The input xml
Returns:
The output of the transformation
Throws:
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException - If the transformer for the xsl could not be created
org.xml.sax.SAXException - If one of the arguments could not be parsed
javax.xml.transform.TransformerConfigurationException - If the transformer could not be created

transform

public void transform(java.lang.String stylesheet,
                      java.io.Reader input,
                      java.io.Writer output)
               throws javax.xml.parsers.ParserConfigurationException,
                      javax.xml.transform.TransformerException,
                      org.xml.sax.SAXException
Executes an xsl transformation.

Parameters:
stylesheet - The xsl that should be executed
input - The input xml
output - The writer for the result of the transformation
Throws:
javax.xml.parsers.ParserConfigurationException - If the parsers could not be created
javax.xml.transform.TransformerException - If the transformer for the xsl could not be created
org.xml.sax.SAXException - If one of the arguments could not be parsed


Copyright © 2007-2011 GX Software BV. All Rights Reserved.