Class Overview
Transforms XML using a defined stylesheet or chain of stylesheets.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Fields
Public Constructors
public
XMLStylesheetTransformer
()
Public Methods
public
String
getValidationMessage
()
public
String
transformFiles
(String sourceXMLPath, String transformationXSLTPath, String destinationXMLPath)
Transforms the XML within the file identified through parameter 'souceXMLPath', into a new XML according to the XSL stylesheet located in 'transformationXSLTPath'.
The outputted XML is stored in the file located through 'destinationXMLPath'.
Parameters
sourceXMLPath
| URI of file where the source XML is located |
transformationXSLTPath
| URI of file where the XSL Stylesheet is located |
destinationXMLPath
| URI of file where the transformed XML is stored |
Returns
- Transformed XML as string
Throws
TransformerException
| |
TransformerConfigurationException
| |
public
XSLTResponse
transformXMLString
(String sourceXML, String[] transformationXSLTChain)
Transforms the XML String passed as input through the 'sourceXML' parameter through a chain of XSL transformations.
The array of XSL Stylesheets identified through parameter 'transformationXSLTChain' are executed in sequence such that, starting from 'sourceXML', each subsequence stylesheet transforms the XML outputted from the previous transformation.
Transformer chaining had to be implemented to cater for cases when XML is embedded within XML using the CDATA structure.
Parameters
sourceXML
| XML String to transform |
transformationXSLTChain
| Array of stylesheets to sequentially use to transform 'sourceXML' |
public
XSLTResponse
transformXMLString
(String sourceXML, String transformationXSLTPath)
Transforms the XML passed as string input in parameter 'sourceXML' into a new XML according to the XSL stylesheet located in 'transformationXSLTPath'.
The transformed XML is passed as output
Parameters
sourceXML
| XML String to transform |
transformationXSLTPath
| URI of file where the XSL Stylesheet is located |
Throws
TransformerException
| |
TransformerConfigurationException
| |
public
XSLTResponse
transformXMLStringFromXSLT
(String sourceXML, String transformationXSLTCode)
Transforms the XML passed as string input in parameter 'sourceXML' into a new XML according to the XSL stylesheet located in 'transformationXSLTPath'.
The transformed XML is passed as output
Parameters
sourceXML
| XML String to transform |
transformationXSLTCode
| The XSL Stylesheet code |
Throws
TransformerException
| |
TransformerConfigurationException
| |
public
String
transformer
(String sourceType, String destinationType, String sourceXML, String mapperURL)
Looks up the stylesheet (or chain of) that maps the Source Type XML schema to the Destination Type. These are located within the wsmapper.xml file.
Parameters
sourceType
| Identifies the schema of the source XML |
destinationType
| Identifies the schema expected in the destination XML |
sourceXML
| The XML string in the source schema |
mapperURL
| |
Returns
- The XML string in the destination schema
public
String
validateXSLT
(String transformationXSLTCode)
Validates the XSLT passed as input
Validation message is passed as output
Parameters
transformationXSLTCode
| The XSL Stylesheet code |
Throws
TransformerException
| |
TransformerConfigurationException
| |