|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.util.xml.xslt.XSLTUtilities
public class XSLTUtilities
A convenience class which provides methods for easy transformation of
XML sources via XSLT. Note that instances of this class, like that of
XMLSourceFactory should not be used by multiple threads concurrently
i.e., should not be assumed to be thread-safe.
Supported API: true
Extendable: false
XSLTransform,
XMLSourceFactory| Constructor Summary | |
|---|---|
XSLTUtilities()
Create an new instance using the default XMLSourceFactory implementation provided with Windchill. |
|
XSLTUtilities(XMLSourceFactory factory)
Create an new instance using a specific instance of XMLSourceFactory. |
|
| Method Summary | |
|---|---|
void |
transform(XMLSource xmlSource,
URL[] urls,
OutputStream output,
Hashtable inputParameters)
Transforms the given XML document using one or more stylesheets. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XSLTUtilities(XMLSourceFactory factory)
factory - public XSLTUtilities()
| Method Detail |
|---|
public void transform(XMLSource xmlSource,
URL[] urls,
OutputStream output,
Hashtable inputParameters)
throws SAXException,
IOException
Example Usage
Using the default implementation, transform http://localhost/test.xml with the XSLT stylesheet http://localhost/test.xsl and save the resulting document in c:/out/test.html.
OutputStream out = new FileOutputStream("C:/out/test.html");
URL[] urls = { new URL("http://localhost/test.xsl") };
XMLSource theSource = factory.newURLSource( new URL ("http://localhost/test.xml")
);
XSLTUtilities xu = new XSLTUtilities();
xu.transform(theSource, urls, out, null);
xmlSource - The XML source. It may be Stream, URL, Reader, DOM, or SAX input.urls - An array of URL's of stylesheets to be applied in succession.output - Where the result of the transformation is writteninputParameters - Hashtable of input parameters that can be used from the stylesheets.
SAXException - if the XML or XSLT cannot be parsed
IOException - if there is an IOException reading
the XML or XSLT or when writing to the output stream
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||