Package org.custommonkey.xmlunit
Class Transform
- java.lang.Object
-
- org.custommonkey.xmlunit.Transform
-
public class Transform extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Transform(java.lang.String input, java.io.File stylesheet)
Create a transformation using String input XML and stylesheet in a FileTransform(java.lang.String input, java.lang.String stylesheet)
Create a transformation using String input XML and String stylesheetTransform(javax.xml.transform.Source inputSource, javax.xml.transform.Source stylesheetSource)
Create a transformation using Source input XML and Source stylesheetTransform(org.w3c.dom.Node sourceNode)
Create a transformation that allows us to serialize a DOM NodeTransform(org.w3c.dom.Node sourceNode, java.io.File stylesheet)
Create a transformation from an input Node and stylesheet in a FileTransform(org.w3c.dom.Node sourceNode, java.lang.String stylesheet)
Create a transformation from an input Node and stylesheet in a StringTransform(org.xml.sax.InputSource input, java.io.File stylesheet)
Create a transformation using InputSource input XML and stylesheet in a FileTransform(org.xml.sax.InputSource input, org.xml.sax.InputSource stylesheet)
Create a transformation using InputSource input XML and InputSource stylesheet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearParameters()
Clear parameters used for the transformationjava.lang.Object
getParameter(java.lang.String name)
See a parameter used for the transformationorg.w3c.dom.Document
getResultDocument()
Perform the XSLT transformation specified in the constructorjava.lang.String
getResultString()
Perform the XSLT transformation specified in the constructorvoid
setErrorListener(javax.xml.transform.ErrorListener errorListener)
Set the ErrorListener for the transformationvoid
setOutputProperties(java.util.Properties outputProperties)
Override output properties specified in the transformation stylesheetvoid
setOutputProperty(java.lang.String name, java.lang.String value)
Override an output property specified in the transformation stylesheetvoid
setParameter(java.lang.String name, java.lang.Object value)
Add a parameter for the transformationvoid
setURIResolver(javax.xml.transform.URIResolver uriResolver)
Set the URIResolver for the transformationprotected void
transformTo(javax.xml.transform.Result result)
Perform the actual transformation
-
-
-
Constructor Detail
-
Transform
public Transform(java.lang.String input, java.lang.String stylesheet)
Create a transformation using String input XML and String stylesheet- Parameters:
input
-stylesheet
-
-
Transform
public Transform(java.lang.String input, java.io.File stylesheet)
Create a transformation using String input XML and stylesheet in a File- Parameters:
input
-stylesheet
-
-
Transform
public Transform(org.xml.sax.InputSource input, org.xml.sax.InputSource stylesheet)
Create a transformation using InputSource input XML and InputSource stylesheet- Parameters:
input
-stylesheet
-
-
Transform
public Transform(org.xml.sax.InputSource input, java.io.File stylesheet)
Create a transformation using InputSource input XML and stylesheet in a File- Parameters:
input
-stylesheet
-
-
Transform
public Transform(org.w3c.dom.Node sourceNode)
Create a transformation that allows us to serialize a DOM Node- Parameters:
source
-
-
Transform
public Transform(org.w3c.dom.Node sourceNode, java.lang.String stylesheet)
Create a transformation from an input Node and stylesheet in a String- Parameters:
sourceNode
-stylesheet
-
-
Transform
public Transform(org.w3c.dom.Node sourceNode, java.io.File stylesheet)
Create a transformation from an input Node and stylesheet in a File- Parameters:
sourceNode
-stylesheet
-
-
Transform
public Transform(javax.xml.transform.Source inputSource, javax.xml.transform.Source stylesheetSource)
Create a transformation using Source input XML and Source stylesheet- Parameters:
inputReader
-stylesheetReader
-
-
-
Method Detail
-
transformTo
protected void transformTo(javax.xml.transform.Result result) throws javax.xml.transform.TransformerException
Perform the actual transformation- Parameters:
result
-- Throws:
javax.xml.transform.TransformerException
-
getResultString
public java.lang.String getResultString() throws javax.xml.transform.TransformerException
Perform the XSLT transformation specified in the constructor- Returns:
- the result as a String
- Throws:
javax.xml.transform.TransformerException
-
getResultDocument
public org.w3c.dom.Document getResultDocument() throws javax.xml.transform.TransformerException
Perform the XSLT transformation specified in the constructor- Returns:
- the result as a DOM Document
- Throws:
javax.xml.transform.TransformerException
-
setOutputProperty
public void setOutputProperty(java.lang.String name, java.lang.String value)
Override an output property specified in the transformation stylesheet- Parameters:
name
-value
-
-
setOutputProperties
public void setOutputProperties(java.util.Properties outputProperties)
Override output properties specified in the transformation stylesheet- Parameters:
outputProperties
-- See Also:
Transformer.setOutputProperties(java.util.Properties)
-
setParameter
public void setParameter(java.lang.String name, java.lang.Object value)
Add a parameter for the transformation- Parameters:
name
-value
-- See Also:
Transformer.setParameter(java.lang.String, java.lang.Object)
-
getParameter
public java.lang.Object getParameter(java.lang.String name)
See a parameter used for the transformation- Parameters:
name
-- Returns:
- the parameter value
- See Also:
Transformer.getParameter(java.lang.String)
-
clearParameters
public void clearParameters()
Clear parameters used for the transformation- See Also:
Transformer.clearParameters()
-
setURIResolver
public void setURIResolver(javax.xml.transform.URIResolver uriResolver)
Set the URIResolver for the transformation- See Also:
Transformer.setURIResolver(javax.xml.transform.URIResolver)
-
setErrorListener
public void setErrorListener(javax.xml.transform.ErrorListener errorListener)
Set the ErrorListener for the transformation- See Also:
Transformer.setErrorListener(javax.xml.transform.ErrorListener)
-
-