Package nl.gx.webmanager.handler.util
Class XSLTransformer
- java.lang.Object
-
- nl.gx.webmanager.handler.util.XSLTransformer
-
public class XSLTransformer extends Object
Apply a transformation from a source, populating a result. Transformers may be reused, but not concurrently- See Also:
Transformer
-
-
Constructor Summary
Constructors Constructor Description XSLTransformer(boolean namespaceAware, boolean validating)
Constructs a new xsl transformer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
transform(String stylesheet, Reader input, Writer output)
Executes an xsl transformation.String
transform(String stylesheet, String xml)
Executes an xsl transformation.
-
-
-
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 String transform(String stylesheet, String xml) throws ParserConfigurationException, TransformerException, SAXException
Executes an xsl transformation.- Parameters:
stylesheet
- The xslxml
- The input xml- Returns:
- The output of the transformation
- Throws:
ParserConfigurationException
TransformerException
- If the transformer for the xsl could not be createdSAXException
- If one of the arguments could not be parsedTransformerConfigurationException
- If the transformer could not be created
-
transform
public void transform(String stylesheet, Reader input, Writer output) throws ParserConfigurationException, TransformerException, SAXException
Executes an xsl transformation.- Parameters:
stylesheet
- The xsl that should be executedinput
- The input xmloutput
- The writer for the result of the transformation- Throws:
ParserConfigurationException
- If the parsers could not be createdTransformerException
- If the transformer for the xsl could not be createdSAXException
- If one of the arguments could not be parsed
-
-