All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.kvisco.xsl.XSLProcessor

com.kvisco.xsl.XSLProcessor

public class XSLProcessor
implements MessageObserver
XSLProcessor An XSL Processor implementing the XSLT WD 1.0
This application is a work in progress.
see the XSLT WD 1.0 (http://www.w3.org/TR/1999/WD-xslt-19990421.html)

Author:
Keith Visco

Variable Index

 o DEFAULT_MESSAGE_OBSERVER
The default MessageObserver
 o DOM_PACKAGE
DOM Package property name
 o ERR_OUTPUT_FLAG
The flag directive for the error log file -- added by Mohan Embar
 o FORMATTER_FLAG
The flag directive for the formatter to use
 o HELP_FLAG
The flag directive for the help screen
 o INDENT_SIZE
Indent Size property name
 o INPUT_FLAG
The flag directive for the xml input file
 o OUTPUT_FLAG
The flag directive for the result tree output file
 o STYLESHEET_FLAG
The flag directive for the stylesheet to use
 o VALIDATE_FLAG
The flag directive for the turning on validation
 o VERSION_FLAG
The flag directive for displaying the version

Constructor Index

 o XSLProcessor()
creates a new XSLProcessor

Method Index

 o addMessageObserver(MessageObserver)
Adds the given MessageObserver to this processors list of MessageObservers
 o getAppInfo()
Retrieves the name and version of this application
 o getDOMPackageName()
Returns the name of the DOM Package being used
 o getProperty(String)
Returns the property value associated with the given String
 o main(String[])
Runs this XSLProcessor based on the given arguments.
 o process(Document, Document)
Processes the specified xml (DOM) Document, using the specified (DOM) xsl stylesheet.
 o process(Document, Document, PrintWriter)
Processes the specified xml (DOM) Document, using the specified xsl (DOM) Document and the default Formatter.
 o process(Document, Document, PrintWriter, Formatter)
Processes the specified xml (DOM) Document, using the specified xsl (DOM) Document and the desired Formatter.
 o process(Document, XSLStylesheet)
Processes the specified xml (DOM) Document, using the specified xsl stylesheet.
 o process(Document, XSLStylesheet, PrintWriter)
Processes the specified xml (DOM) Document, using the specified xsl stylesheet, and the default Formatter.
 o process(Document, XSLStylesheet, PrintWriter, Formatter)
Processes the specified xml (DOM) Document, using the specified xsl stylesheet, and the desired Formatter.
 o process(InputStream, InputStream)
Processes the specified xml InputStream, using the specified xsl InputStream.
 o process(InputStream, InputStream, PrintWriter)
Processes the specified xml InputStream, using the specified xsl InputStream, and the default Formatter.
 o process(InputStream, InputStream, PrintWriter, Formatter)
Processes the specified xml InputStream, using the specified xsl InputStream, and the desired Formatter.
 o process(String)
Processes the specified xml file, using the stylesheet specified by the xml stylesheet PI.
 o process(String, PrintWriter)
Processes the specified xml file, using the stylesheet specified by the xml stylesheet PI, and the default Formatter.
 o process(String, String)
Processes the specified xml file, using the specified xsl file.
 o process(String, String, PrintWriter)
Processes the specified xml file, using the specified xsl file, and the default Formatter.
 o process(String, String, PrintWriter, Formatter)
Processes the specified xml file, using the specified xsl file, and the desired Formatter.
 o recieveMessage(String)
 o recieveMessage(String)
Recieves a message
 o removeMessageObserver(MessageObserver)
Removes the given MessageObserver from this processors list of MessageObservers
 o setDocumentBase(String)
Sets the document base for resolving relative URLs
 o setDOMReader(DOMReader)
Sets the DOMReader that will be used to read in XML Documents
 o setErrorStream(PrintStream)
Sets the stream for this XSLProcessor to print errors to.
 o setErrorStream(Writer)
Sets the stream for this XSLProcessor to print errors to.
 o setProperty(String, String)
Sets the property value associated with the given String.
 o setValidation(boolean)
Sets whether or not to validate when reading an XML document.

Variables

 o HELP_FLAG
 public static final String HELP_FLAG
The flag directive for the help screen

 o INPUT_FLAG
 public static final String INPUT_FLAG
The flag directive for the xml input file

 o FORMATTER_FLAG
 public static final String FORMATTER_FLAG
The flag directive for the formatter to use

 o OUTPUT_FLAG
 public static final String OUTPUT_FLAG
The flag directive for the result tree output file

 o STYLESHEET_FLAG
 public static final String STYLESHEET_FLAG
The flag directive for the stylesheet to use

 o VALIDATE_FLAG
 public static final String VALIDATE_FLAG
The flag directive for the turning on validation

 o VERSION_FLAG
 public static final String VERSION_FLAG
The flag directive for displaying the version

 o ERR_OUTPUT_FLAG
 public static final String ERR_OUTPUT_FLAG
The flag directive for the error log file -- added by Mohan Embar

 o DOM_PACKAGE
 public static final String DOM_PACKAGE
DOM Package property name

 o INDENT_SIZE
 public static final String INDENT_SIZE
Indent Size property name

 o DEFAULT_MESSAGE_OBSERVER
 public static final MessageObserver DEFAULT_MESSAGE_OBSERVER
The default MessageObserver

Constructors

 o XSLProcessor
 public XSLProcessor()
creates a new XSLProcessor

Methods

 o addMessageObserver
 public void addMessageObserver(MessageObserver msgObserver)
Adds the given MessageObserver to this processors list of MessageObservers

Parameters:
msgObserver - the MessageObserver to add to this processors list of MessageObservers
 o getAppInfo
 public static String getAppInfo()
Retrieves the name and version of this application

Returns:
s a String with the name and version of this application
 o getDOMPackageName
 public String getDOMPackageName()
Returns the name of the DOM Package being used

See Also:
properties
 o getProperty
 public String getProperty(String property)
Returns the property value associated with the given String

Returns:
the property value associated with the given String
See xslp.properties for for a list of properties
 o main
 public static void main(String args[])
Runs this XSLProcessor based on the given arguments. This method can be called from another Class however, one of the process methods should be more appropriate

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"}
 o process
 public void process(String xmlFilename,
                     PrintWriter out)
Processes the specified xml file, using the stylesheet specified by the xml stylesheet PI, and the default Formatter. All results are sent to the Writer.

Parameters:
xmlFilename - the path to the XML file to process
out - the Writer to print all processing results to.
 o process
 public Document process(String xmlFilename)
Processes the specified xml file, using the stylesheet specified by the xml stylesheet PI. All results are sent to the Writer.

Parameters:
xmlFilename - the path to the XML file to process
Returns:
s the resulting Document
 o process
 public void process(String xmlFilename,
                     String xslFilename,
                     PrintWriter out)
Processes the specified xml file, using the specified xsl file, and the default Formatter. All results are sent to the Writer.

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 PrintWriter to print all processing results to.
 o process
 public void process(String xmlFilename,
                     String xslFilename,
                     PrintWriter out,
                     Formatter formatter)
Processes the specified xml file, using the specified xsl file, and the desired Formatter. All results are sent to the PrintWriter.

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.
out - the PrintWriter to print all processing results to.
formatter - the FlowObjectHandler to use for processing the Stylesheet
 o process
 public Document process(String xmlFilename,
                         String xslFilename)
Processes the specified xml file, using the specified xsl file.

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
 o process
 public Document process(InputStream xmlInput,
                         InputStream xslInput)
Processes the specified xml InputStream, using the specified xsl InputStream.

Parameters:
xmlInput - the InputStream of the XML to process
xslInput - the InputStream of the XSL 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.
Returns:
the resulting Document
 o process
 public void process(InputStream xmlInput,
                     InputStream xslInput,
                     PrintWriter out)
Processes the specified xml InputStream, using the specified xsl InputStream, and the default Formatter. All results are sent to the specified PrintWriter.

Parameters:
xmlInput - the InputStream of the XML to process
xslInput - the InputStream of the XSL 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 PrintWriter to print all processing results to.
 o process
 public void process(InputStream xmlInput,
                     InputStream xslInput,
                     PrintWriter out,
                     Formatter formatter)
Processes the specified xml InputStream, using the specified xsl InputStream, and the desired Formatter. All results are sent to the specified PrintWriter.

Parameters:
xmlInput - the InputStream of the XML to process
xslInput - the InputStream of the XSL 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 PrintWriter to print all processing results to.
formatter - the Formatter to use for processing the stylesheet
 o process
 public Document process(Document xmlDocument,
                         Document xslDocument)
Processes the specified xml (DOM) Document, using the specified (DOM) xsl stylesheet.

Parameters:
xmlDocument - the XML Document to process
xslDocument - the XSL Document to use for processing.
Returns:
the resulting Document
 o process
 public void process(Document xmlDocument,
                     Document xslDocument,
                     PrintWriter out)
Processes the specified xml (DOM) Document, using the specified xsl (DOM) Document and the default Formatter. All results are sent to the specified PrintWriter.

Parameters:
xmlDocument - the XML Document to process
xslDocument - the XSL Document to use for processing.
out - the PrintWriter to print all processing results to.
 o process
 public void process(Document xmlDocument,
                     Document xslDocument,
                     PrintWriter out,
                     Formatter formatter)
Processes the specified xml (DOM) Document, using the specified xsl (DOM) Document and the desired Formatter. All results are sent to the specified PrintWriter.

Parameters:
xmlDocument - the XML Document to process
xslDocument - the XSL Document to use for processing.
out - the PrintWriter to print all processing results to.
formatter - the desired Formatter to use during processing
 o process
 public Document process(Document xmlDocument,
                         XSLStylesheet stylesheet)
Processes the specified xml (DOM) Document, using the specified xsl stylesheet.

Parameters:
xmlDocument - the XML Document to process
stylesheet - the XSLStylesheet to use for processing.
Returns:
the resulting Document
 o process
 public void process(Document xmlDocument,
                     XSLStylesheet stylesheet,
                     PrintWriter out)
Processes the specified xml (DOM) Document, using the specified xsl stylesheet, and the default Formatter. All results are sent to the specified PrintWriter.

Parameters:
xmlDocument - the XML Document to process
stylesheet - the XSLStylesheet to use for processing.
out - the PrintWriter to print all processing results to.
 o process
 public void process(Document xmlDocument,
                     XSLStylesheet stylesheet,
                     PrintWriter out,
                     Formatter formatter)
Processes the specified xml (DOM) Document, using the specified xsl stylesheet, and the desired Formatter. All results are sent to the specified PrintWriter.

Parameters:
xmlDocument - the XML Document to process
stylesheet - the XSLStylesheet to use for processing.
out - the PrintWriter to print all processing results to.
formatter - the desired Formatter to use during processing
 o recieveMessage
 public void recieveMessage(String message)
Recieves a message

Parameters:
message - the message to recieve
See Also:
MessageObserver
 o removeMessageObserver
 public MessageObserver removeMessageObserver(MessageObserver msgObserver)
Removes the given MessageObserver from this processors list of MessageObservers

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
 o setDocumentBase
 public void setDocumentBase(String documentBase)
Sets the document base for resolving relative URLs

Parameters:
documentBase - the document base to use while processing.
 o setDOMReader
 public void setDOMReader(DOMReader domReader)
Sets the DOMReader that will be used to read in XML Documents

Parameters:
domReader - the DOMReader that is to be used to read in XML Documents
 o setErrorStream
 public void setErrorStream(PrintStream errorStream)
Sets the stream for this XSLProcessor to print errors to.

Parameters:
errorStream - the PrintStream to print all errors to.
 o setErrorStream
 public void setErrorStream(Writer errorWriter)
Sets the stream for this XSLProcessor to print errors to.

Parameters:
errorWriter - the Writer to print all errors to.
 o setProperty
 public void setProperty(String property,
                         String value)
Sets the property value associated with the given String.

 o setValidation
 public void setValidation(boolean validate)
Sets whether or not to validate when reading an XML document.

Parameters:
validate - the boolean indicating whether to validate or not

All Packages  Class Hierarchy  This Package  Previous  Next  Index