|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.util.XSLTUtilities
A collection of utilities for manipulating strings using XSLT These utilities do not depend on any other ptolemy.* packages.
This file uses Saxon, the XSLT and XQuery Processor http://saxon.sourceforge.net.
Between Java 1.4.x and Java 1.5, Xalan was removed from the jar files that are shipped. Since Caltrop uses Saxon anyway, we now use Saxon here as well.
| Red (cxh) |
| Yellow (eal) |
| Method Summary | |
static void |
main(java.lang.String[] args)
Read an input file and one or more xsl files and generate the output file java -classpath $PTII ptolemy.util.XSLTUtilities $PTII/ptolemy/hsif/demo/SwimmingPool/SwimmingPool.xml \ $PTII/ptolemy/hsif/xsl/GlobalVariablePreprocessor.xsl \ /tmp/SwimmingPool_1.xml |
static org.w3c.dom.Document |
parse(java.lang.String filename)
Parse a document. |
static java.lang.String |
toString(org.w3c.dom.Document document)
Given a Document, generate a String. |
static org.w3c.dom.Document |
transform(org.w3c.dom.Document inputDocument,
java.util.List xslFileNames)
Transform a document. |
static org.w3c.dom.Document |
transform(org.w3c.dom.Document inputDocument,
java.lang.String xslFileName)
Transform a document |
static void |
transform(java.lang.String xsltFileName,
java.lang.String sourceFileName,
java.lang.String resultFileName)
Transform a document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void main(java.lang.String[] args)
throws java.lang.Exception
java -classpath $PTII ptolemy.util.XSLTUtilities
$PTII/ptolemy/hsif/demo/SwimmingPool/SwimmingPool.xml \
$PTII/ptolemy/hsif/xsl/GlobalVariablePreprocessor.xsl \
/tmp/SwimmingPool_1.xml
args - At least three arguments:
java.lang.Exception - If there are problems with the transform.
public static org.w3c.dom.Document parse(java.lang.String filename)
throws java.lang.Exception
filename - The file name of the xml file to be read in
The filename is passed to org.xml.sax.InputSource(String),
so it may be a file name or a URL.
java.lang.Exception - Thrown if there is a problem with the
transformation.
public static java.lang.String toString(org.w3c.dom.Document document)
throws java.lang.Exception
document - The document to be converted to a string.
java.lang.Exception
public static org.w3c.dom.Document transform(org.w3c.dom.Document inputDocument,
java.lang.String xslFileName)
throws java.lang.Exception
inputDocument - The Document to be transformedxslFileName - The file name of the xsl file to be used.
If the file cannot be found, then we look up the file in the classpath.
Thrown - if there is a problem with the transformation.
java.lang.Exception
public static org.w3c.dom.Document transform(org.w3c.dom.Document inputDocument,
java.util.List xslFileNames)
throws java.lang.Exception
inputDocument - The Document to be transformedxslFileNames - A list of Strings naming the
xsl files to be applied sequentially.
Thrown - if there is a problem with the transformation.
java.lang.Exception
public static void transform(java.lang.String xsltFileName,
java.lang.String sourceFileName,
java.lang.String resultFileName)
throws java.lang.Exception
xsltFileName - The name of the xsl file to be used.sourceFileName - The name of the file to be read in and
transformed.resultFileName - The name of the file to be generated.
Thrown - if there is a problem with the transformation.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||