public class Transform extends Object
Constructor and Description |
---|
Transform() |
Modifier and Type | Method and Description |
---|---|
static Transformer |
getTransformer(String xslFile)
Get a new transformer based on a stylesheet
|
static Transformer |
getTransformer(String xslFile,
HashMap<String,Templates> cache)
Load a stylesheet and maintain it in memory for reuse.
|
static StreamSource |
getURLSource(String url)
Get a
StreamSource to the response of invoking a URL. |
static void |
main(String[] args)
Command-line interface
|
static void |
perform(InputStream xmlStream,
String xslFile,
JspWriter outStream)
Use an XML style sheet to transform an XML document and write the results
to an
JspWriter . |
static void |
perform(InputStream xmlStream,
String xslFile,
PrintWriter outWriter)
Use an XML style sheet to transform an XML document and write the results
to an
PrintWriter . |
static void |
perform(StreamSource xmlStream,
String xslFile,
PrintStream outStream)
Use an XML style sheet to transform an XML document and write the results
to an
PrintWriter . |
static void |
perform(StringReader xmlFile,
String xslFile,
JspWriter outStream)
Use an XML style sheet to transform an XML document and write the results
to an
JspWriter . |
static void |
perform(String xmlFile,
String xslFile,
JspWriter outStream)
Use an XML style sheet to transform an XML document and write the results
to an
JspWriter . |
static void |
perform(String xmlFile,
String xslFile,
PrintStream outStream)
Use an XML style sheet to transform an XML document and write the results
to an
PrintStream . |
static void |
perform(String xmlFile,
String xslFile,
PrintWriter outWriter)
Use an XML style sheet to transform an XML document and write the results
to an
PrintWriter . |
static void |
performOnURL(String url,
String xslFile,
JspWriter outStream)
Use an XML style sheet to transform an XML document returned by a URL and write the results
to an
JspWriter . |
void |
showHelp()
Display help information.
|
public static void main(String[] args)
args
- the arguments passed on the command-line.public void showHelp()
public static Transformer getTransformer(String xslFile) throws TransformerException
xslFile
- the pathname to the XML stylesheet file.Transformer
prepared to use the passed stylesheet.TransformerException
public static Transformer getTransformer(String xslFile, HashMap<String,Templates> cache) throws TransformerException
xslFile
- the pathname to the XML stylesheet file.cache
- the HashMap
to maintain the prepared stylesheets.Transformer
prepared to use the passed stylesheet.TransformerException
public static StreamSource getURLSource(String url) throws Exception
StreamSource
to the response of invoking a URL.url
- the URL of the resource to transform.StreamSource
for the URL.Exception
public static void perform(StreamSource xmlStream, String xslFile, PrintStream outStream) throws Exception
PrintWriter
.xmlStream
- the StreamSource
to the XML text.xslFile
- the pathname to the XML stylesheet file.outStream
- the PrintStream
to write the results.Exception
public static void perform(String xmlFile, String xslFile, PrintWriter outWriter) throws Exception
PrintWriter
.xmlFile
- the pathname to the XML file.xslFile
- the pathname to the XML stylesheet file.outWriter
- the PrintWriter
to write the results.Exception
public static void perform(InputStream xmlStream, String xslFile, PrintWriter outWriter) throws Exception
PrintWriter
.xmlStream
- the InputStream
for the XML text.xslFile
- the pathname to the XML stylesheet file.outWriter
- the PrintWriter
to write the results.Exception
public static void perform(String xmlFile, String xslFile, PrintStream outStream) throws Exception
PrintStream
.xmlFile
- the pathname to the XML file.xslFile
- the pathname to the XML stylesheet file.outStream
- the PrintStream
to write the results.Exception
public static void perform(String xmlFile, String xslFile, JspWriter outStream) throws Exception
JspWriter
. A JspWriter
is the default output stream
for JSP pages.xmlFile
- the pathname to the XML file.xslFile
- the pathname to the XML stylesheet file.outStream
- the JspWriter
to write the results.Exception
public static void perform(StringReader xmlFile, String xslFile, JspWriter outStream) throws Exception
JspWriter
. A JspWriter
is the default output stream
for JSP pages.xmlFile
- the StringReader
for the XML text.xslFile
- the pathname to the XML stylesheet file.outStream
- the JspWriter
to write the results.Exception
public static void perform(InputStream xmlStream, String xslFile, JspWriter outStream) throws Exception
JspWriter
. A JspWriter
is the default output stream
for JSP pages.xmlStream
- the InputStream
for the XML text.xslFile
- the pathname to the XML stylesheet file.outStream
- the JspWriter
to write the results.Exception
public static void performOnURL(String url, String xslFile, JspWriter outStream) throws Exception
JspWriter
. A JspWriter
is the default output stream
for JSP pages.url
- the URL of the resource to transform.xslFile
- the pathname to the XML stylesheet file.outStream
- the JspWriter
to write the results.Exception
Copyright © 2008-2015 Regents University of California. All Rights Reserved.