org.exolab.adaptx.xslt
public class XSLTProcessor extends ErrorObserverAdapter implements MessageObserver
Version: $Revision: 4776 $ $Date: 2004-09-28 15:46:27 -0400 (Tue, 28 Sep 2004) $
Field Summary | |
---|---|
static String | ERR_OUTPUT_FLAG
The flag directive for the error log file
-- added by Mohan Embar
|
static String | HELP_FLAG
The flag directive for the help screen
|
static String | INDENT_SIZE
Indent Size property name
|
static String | INPUT_FLAG
The flag directive for the xml input file
|
static String | OUTPUT_FLAG
The flag directive for the result tree output file
|
static String | STYLESHEET_FLAG
The flag directive for the stylesheet to use
|
static String | VALIDATE_FLAG
The flag directive for the turning on validation
|
static String | VERSION_FLAG
The flag directive for displaying the version
|
Constructor Summary | |
---|---|
XSLTProcessor()
Creates a new XSLTProcessor
|
Method Summary | |
---|---|
void | addErrorObserver(ErrorObserver observer)
Adds the given ErrorObserver to the list of ErrorObservers
for this processor |
void | addFunctionResolver(FunctionResolver fnResolver)
Adds the given FunctionResolver used for resovling
extension functions. |
void | addMessageObserver(MessageObserver msgObserver)
Adds the given MessageObserver to this processors list
of MessageObservers |
static URILocation | createURILocation(Reader reader, String filename)
Creates a URILocation for the given Reader and Filename.
|
static String | getAppInfo()
Retrieves the name and version of this application |
XSLOutput | getOutputProperties()
Returns the XSLOutput object containing the
output properties. |
String | getParameter(String name)
Returns the value of the top-level parameter
associated with the given name.
|
Enumeration | getParameterNames()
Returns an enumeration of all top-level parameter names.
|
String | getProperty(String property)
Returns the property value associated with the given String |
static void | main(String[] args)
Runs this XSLProcessor based on the given arguments.
|
void | process(String xmlFilename, Writer out)
Processes the specified xml file, using the stylesheet specified
by the xml stylesheet PI, and the default ResultHandler.
|
Document | process(String xmlFilename)
Processes the specified xml file, using the stylesheet specified
by the xml stylesheet PI, and returns the resulting document.
|
void | process(String xmlFilename, String xslFilename, Writer out)
Processes the specified xml file, using the specified xsl file, and
the default ResultHandler.
|
void | process(String xmlFilename, XSLTStylesheet stylesheet, Writer out)
Processes the specified xml file, using the specified xsl file, and
the default ResultHandler.
|
void | process(String xmlFilename, String xslFilename, ResultHandler handler)
Processes the specified xml file, using the specified xsl file, and
the desired ResultHandler.
|
void | process(String xmlFilename, XSLTStylesheet stylesheet, ResultHandler handler)
Processes the specified xml file, using the specified xsl file, and
the desired ResultHandler.
|
Document | process(String xmlFilename, String xslFilename)
Processes the specified xml file, using the specified xsl file. |
Document | process(URILocation xmlLocation, URILocation xslLocation)
Processes the specified xml URILocation, using the specified xslt
stylesheet URILocation, and the desired ResultHandler.
|
void | process(URILocation xmlLocation, URILocation xslLocation, ResultHandler handler)
Processes the specified xml URILocation, using the specified xslt
stylesheet URILocation, and the desired ResultHandler.
|
void | process(URILocation xmlLocation, XSLTStylesheet stylesheet, ResultHandler handler)
Processes the specified xml URILocation, using the specified xslt
stylesheet, and the desired ResultHandler.
|
Document | process(Document xmlDocument, Document xslDocument)
Processes the specified xml (DOM) Document, using the specified
(DOM) xsl stylesheet. |
void | process(Document xmlDocument, Document xslDocument, Writer out)
Processes the specified xml (DOM) Document, using the specified
xsl (DOM) Document and the default ResultHandler.
|
void | process(Document xmlDocument, Document xslDocument, ResultHandler handler)
Processes the specified xml (DOM) Document, using the specified
xsl (DOM) Document and the desired ResultHandler.
|
XPathNode | process(XPathNode source, XSLTStylesheet stylesheet)
Processes the specified xml (DOM) Document, using the specified xsl
stylesheet.
|
Document | process(Document xmlDocument, XSLTStylesheet stylesheet)
Processes the specified xml (DOM) Document, using the specified xsl
stylesheet.
|
void | process(XPathNode source, XSLTStylesheet stylesheet, Writer out)
Processes the specified xml (DOM) Document, using the specified xsl
stylesheet, and the default ResultHandler.
|
void | process(Document xmlDocument, XSLTStylesheet stylesheet, Writer out)
Processes the specified xml (DOM) Document, using the specified xsl
stylesheet, and the default ResultHandler.
|
void | process(XPathNode source, XSLTStylesheet stylesheet, ResultHandler handler)
Processes the specified xml source node (XPathNode),
using the specified xsl stylesheet, and the desired ResultHandler.
|
void | process(Document xmlDocument, XSLTStylesheet stylesheet, ResultHandler handler)
Processes the specified xml (DOM) Document, using the specified xsl
stylesheet, and the desired ResultHandler.
|
void | receiveMessage(String message)
Recieves a message |
void | removeAllParameters()
Removes all the top-level parameter bindings
|
void | removeFunctionResolver(FunctionResolver fnResolver)
Removes the given FunctionResolver from the list of
extension function resolvers. |
MessageObserver | removeMessageObserver(MessageObserver msgObserver)
Removes the given MessageObserver from this processors list
of MessageObservers |
void | removeParameter(String name)
Removes the top-level parameter binding with the given name
|
void | setDocumentBase(String documentBase)
Sets the document base for resolving relative URLs |
void | setDOMParser(DOMParser domParser)
Sets the DOMParser that will be used to read in XML Documents |
void | setOutputProperties(XSLOutput output)
Sets the XSLOutput object containing the
output properties. |
void | setParameter(String name, String value)
Sets a parameter which may be accessed using a top-level
parameter in the XSLT Stylesheet. |
void | setProperty(String property, String value)
Sets the property value associated with the given String. |
void | setURIResolver(URIResolver resolver)
Sets the URIResolver for resolving all URIs. |
void | setValidation(boolean validate)
Sets whether or not to validate when reading an XML document.
|
Parameters: observer the ErrorObserver to add
Parameters: fnResolver the FunctionResolver to add
See Also: org.exolab.adaptx.xpath.FunctionResolver
Parameters: msgObserver the MessageObserver to add to this processors list of MessageObservers
Parameters: reader the Reader to create the URILocation for filename, the absolute filename for the URILocation
Returns: the new URILocation
UNKNOWN: a String with the name and version of this application
Returns: the XSLOutput object, or null if not set.
Parameters: name the name of the top-level parameter whose value should be returned.
Returns: the parameter value
See Also: getParameterNames removeParameter removeAllParameters setParameter
Returns: an enumeration of all top-level parameter names.
See Also: getParameter removeParameter removeAllParameters setParameter
Returns: the property value associated with the given String
See xslp.properties for for a list of properties
Parameters: args a list of arguments to this XSLProcessor
Though I do not recommend the following, if you need a static
call to XSL:P use the following:
args = {"-i", "xmlfile.xml", "-s", "style.xsl","-o","result.html"}
-- OR --
args = {"-ixmlfile.xml", "-sstyle.xsl","-oresult.html"}
If the Stylesheet is referenced by the
processing instruction use the following
args = {"-ixmlfile.xml","-oresult.html"}
Parameters: xmlFilename the path to the XML file to process out the Writer to print all processing results to.
Parameters: xmlFilename the path to the XML file to process
UNKNOWN: the resulting Document
Parameters: xmlFilename the href to the XML file to process xslFilename the href to the XSL file to use for processing. This stylesheet will supercede any embedded stylesheets in the xsl document. Set to null, to allow xml:stylesheet PI to be processed. out the Writer to print all processing results to.
Parameters: xmlFilename the href to the XML file to process stylesheet the XSLStylesheet to use for processing This stylesheet will supercede any embedded stylesheets in the xsl document. Set to null, to allow xml:stylesheet PI to be processed. out the Writer to print all processing results to.
Parameters: xmlFilename the path to the XML file to process xslFilename the path to the XSL file to use for processing. This stylesheet will supercede any embedded stylesheets in the xsl document. handler the ResultHandler which handles the result tree.
Parameters: xmlFilename the path to the XML file to process stylesheet the XSLStylesheet to use for processing. This stylesheet will supercede any embedded stylesheets in the xsl document. handler the ResultHandler which handles the result tree.
Parameters: xmlFilename the path to the XML file to process xslFilename the path to the XSL file to use for processing. This stylesheet will supercede any embedded stylesheets in the xsl document.
Returns: the resulting Document
Parameters: xmlLocation the URILocation for the input XML source xslLocation the URILocation for the stylesheet to use. If present this stylesheet will supercede any embedded stylesheets in the xml document. Set to null, to allow the xml:stylesheet PI to be processed.
Returns: the resulting DOM Document
Parameters: xmlLocation the URILocation for the input XML source xslLocation the URILocation for the stylesheet to use. If present this stylesheet will supercede any embedded stylesheets in the xml document. Set to null, to allow the xml:stylesheet PI to be processed. handler the ResultHandler to use for processing the stylesheet
Parameters: xmlLocation the URILocation for the input XML source stylesheet the XSLTStylesheet to use (may be null). If present this stylesheet will supercede any embedded stylesheets in the xml document. Set to null, to allow the xml:stylesheet PI to be processed. handler the ResultHandler to use for processing the stylesheet
Parameters: xmlDocument the XML Document to process xslDocument the XSL Document to use for processing.
Returns: the resulting Document
Parameters: xmlDocument the XML Document to process xslDocument the XSL Document to use for processing. out the Writer to print all processing results to.
Parameters: xmlDocument the XML Document to process xslDocument the XSL Document to use for processing. out the PrintWriter to print all processing results to. handler the desired ResultHandler to use during processing
Parameters: xmlDocument the XML Document to process stylesheet the XSLStylesheet to use for processing.
Returns: the resulting Document
Parameters: xmlDocument the XML Document to process stylesheet the XSLStylesheet to use for processing.
Returns: the resulting Document
Parameters: source the XML source node (XPathNode) to process stylesheet the XSLStylesheet to use for processing. out the Writer to print all processing results to.
Parameters: xmlDocument the XML Document to process stylesheet the XSLStylesheet to use for processing. out the PrintWriter to print all processing results to.
Parameters: source the XML source node to process stylesheet the XSLStylesheet to use for processing. handler the ResultHandler to handle the result.
Parameters: xmlDocument the XML Document to process stylesheet the XSLStylesheet to use for processing. handler the desired ResultHandler to use during processing
See Also: removeParameter setParameter
Parameters: fnResolver the FunctionResolver to remove
See Also: org.exolab.adaptx.xpath.FunctionResolver
Parameters: msgObserver the MessageObserver to remove from this processors list of MessageObservers
Returns: the given MessageObserver if it was removed from the list, otherwise return null
Parameters: name the name of the parameter binding to remove
See Also: removeAllParameters setParameter
Parameters: documentBase the document base to use while processing.
Parameters: domParser the DOMParser that is to be used to read in
XML Documents
Note:This will make a call to Configuration#setDOMParser
which is static, so this DOMParser will be shared by all
instances of XSL:P running in the same VM.
Parameters: output the XSLOutput object to set.
Parameters: name the name of the parameter value the value of the parameter
UNKNOWN: the property to set the value of the property
See xslp.properties for for a list of properties
Parameters: resolver the URIResolver to use
Parameters: validate the boolean indicating whether to validate or not
Since: 19990408