public class XMLTransformer
extends java.lang.Object
transform(File, File, File)
,
transform(File, File, File, String)
,
main(String[])
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_XSLT_VERSION |
static java.lang.String |
XSLT_VERSION_1 |
static java.lang.String |
XSLT_VERSION_2 |
Constructor and Description |
---|
XMLTransformer() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Primarily for testing.
|
static void |
transform(java.io.File xmlfile,
java.io.File xslfile,
java.io.File outfile)
Transforms an
xmlfile , using an xslfile to an
outfile using whatever javax.xml.transform TransformerFactory is setup. |
static void |
transform(java.io.File xmlfile,
java.io.File xslfile,
java.io.File outfile,
java.lang.String version)
Transforms an
xmlfile , using an xslfile to an
outfile using whatever javax.xml.transform TransformerFactory is setup,
the last parameter version decides what TransformerFactory will be used. |
public static final java.lang.String XSLT_VERSION_1
public static final java.lang.String XSLT_VERSION_2
public static final java.lang.String DEFAULT_XSLT_VERSION
public static void transform(java.io.File xmlfile, java.io.File xslfile, java.io.File outfile) throws java.io.FileNotFoundException, javax.xml.transform.TransformerException
xmlfile
, using an xslfile
to an
outfile
using whatever javax.xml.transform TransformerFactory is setup.
Currently, this is the default platform-specific one.xmlfile
- String, the File with full path to an XML source filexslfile
- String, the File with full path to an XSL source fileoutfile
- String, the File with full path for the output file
java.io.FileNotFoundException
- if the XML or XSL source files cannot be found.javax.xml.transform.TransformerException
- if the transform could not be completed successfully for various reasons.
TransformerFactory.newInstance()
,
TransformerFactoryConfigurationError
,
TransformerConfigurationException
public static void transform(java.io.File xmlfile, java.io.File xslfile, java.io.File outfile, java.lang.String version) throws java.io.FileNotFoundException, javax.xml.transform.TransformerException
xmlfile
, using an xslfile
to an
outfile
using whatever javax.xml.transform TransformerFactory is setup,
the last parameter version decides what TransformerFactory will be used.xmlfile
- String, the File with full path to an XML source filexslfile
- String, the File with full path to an XSL source fileoutfile
- String, the File with full path for the output fileversion
- String, 1.0 or 2.0. Decides what TransformerFactory will be used
java.io.FileNotFoundException
- if the XML or XSL source files cannot be found.javax.xml.transform.TransformerException
- if the transform could not be completed successfully for various reasons.
TransformerFactory.newInstance()
,
TransformerFactoryConfigurationError
,
TransformerConfigurationException
public static void main(java.lang.String[] args)
args
- args[0] the full path to an XML source file#convert(File, File, File)
Copyright © SAS Institute. All Rights Reserved.