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
-
DEFAULT_MESSAGE_OBSERVER
- The default MessageObserver
-
DOM_PACKAGE
- DOM Package property name
-
ERR_OUTPUT_FLAG
- The flag directive for the error log file
-- added by Mohan Embar
-
FORMATTER_FLAG
- The flag directive for the formatter to use
-
HELP_FLAG
- The flag directive for the help screen
-
INDENT_SIZE
- Indent Size property name
-
INPUT_FLAG
- The flag directive for the xml input file
-
OUTPUT_FLAG
- The flag directive for the result tree output file
-
STYLESHEET_FLAG
- The flag directive for the stylesheet to use
-
VALIDATE_FLAG
- The flag directive for the turning on validation
-
VERSION_FLAG
- The flag directive for displaying the version
-
XSLProcessor()
- creates a new XSLProcessor
-
addMessageObserver(MessageObserver)
- Adds the given MessageObserver to this processors list
of MessageObservers
-
getAppInfo()
- Retrieves the name and version of this application
-
getDOMPackageName()
- Returns the name of the DOM Package being used
-
getProperty(String)
- Returns the property value associated with the given String
-
main(String[])
- Runs this XSLProcessor based on the given arguments.
-
process(Document, Document)
- Processes the specified xml (DOM) Document, using the specified
(DOM) xsl stylesheet.
-
process(Document, Document, PrintWriter)
- Processes the specified xml (DOM) Document, using the specified
xsl (DOM) Document and the default Formatter.
-
process(Document, Document, PrintWriter, Formatter)
- Processes the specified xml (DOM) Document, using the specified
xsl (DOM) Document and the desired Formatter.
-
process(Document, XSLStylesheet)
- Processes the specified xml (DOM) Document, using the specified xsl
stylesheet.
-
process(Document, XSLStylesheet, PrintWriter)
- Processes the specified xml (DOM) Document, using the specified xsl
stylesheet, and the default Formatter.
-
process(Document, XSLStylesheet, PrintWriter, Formatter)
- Processes the specified xml (DOM) Document, using the specified xsl
stylesheet, and the desired Formatter.
-
process(InputStream, InputStream)
- Processes the specified xml InputStream, using the specified xsl
InputStream.
-
process(InputStream, InputStream, PrintWriter)
- Processes the specified xml InputStream, using the specified xsl
InputStream, and the default Formatter.
-
process(InputStream, InputStream, PrintWriter, Formatter)
- Processes the specified xml InputStream, using the specified xsl
InputStream, and the desired Formatter.
-
process(String)
- Processes the specified xml file, using the stylesheet specified
by the xml stylesheet PI.
-
process(String, PrintWriter)
- Processes the specified xml file, using the stylesheet specified
by the xml stylesheet PI, and the default Formatter.
-
process(String, String)
- Processes the specified xml file, using the specified xsl file.
-
process(String, String, PrintWriter)
- Processes the specified xml file, using the specified xsl file, and
the default Formatter.
-
process(String, String, PrintWriter, Formatter)
- Processes the specified xml file, using the specified xsl file, and
the desired Formatter.
-
recieveMessage(String)
-
-
recieveMessage(String)
- Recieves a message
-
removeMessageObserver(MessageObserver)
- Removes the given MessageObserver from this processors list
of MessageObservers
-
setDocumentBase(String)
- Sets the document base for resolving relative URLs
-
setDOMReader(DOMReader)
- Sets the DOMReader that will be used to read in XML Documents
-
setErrorStream(PrintStream)
- Sets the stream for this XSLProcessor to print errors to.
-
setErrorStream(Writer)
- Sets the stream for this XSLProcessor to print errors to.
-
setProperty(String, String)
- Sets the property value associated with the given String.
-
setValidation(boolean)
- Sets whether or not to validate when reading an XML document.
HELP_FLAG
public static final String HELP_FLAG
- The flag directive for the help screen
INPUT_FLAG
public static final String INPUT_FLAG
- The flag directive for the xml input file
FORMATTER_FLAG
public static final String FORMATTER_FLAG
- The flag directive for the formatter to use
OUTPUT_FLAG
public static final String OUTPUT_FLAG
- The flag directive for the result tree output file
STYLESHEET_FLAG
public static final String STYLESHEET_FLAG
- The flag directive for the stylesheet to use
VALIDATE_FLAG
public static final String VALIDATE_FLAG
- The flag directive for the turning on validation
VERSION_FLAG
public static final String VERSION_FLAG
- The flag directive for displaying the version
ERR_OUTPUT_FLAG
public static final String ERR_OUTPUT_FLAG
- The flag directive for the error log file
-- added by Mohan Embar
DOM_PACKAGE
public static final String DOM_PACKAGE
- DOM Package property name
INDENT_SIZE
public static final String INDENT_SIZE
- Indent Size property name
DEFAULT_MESSAGE_OBSERVER
public static final MessageObserver DEFAULT_MESSAGE_OBSERVER
- The default MessageObserver
XSLProcessor
public XSLProcessor()
- creates a new XSLProcessor
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
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
getDOMPackageName
public String getDOMPackageName()
- Returns the name of the DOM Package being used
- See Also:
- properties
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
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"}
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.
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
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.
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
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
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
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.
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
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
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.
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
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
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.
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
recieveMessage
public void recieveMessage(String message)
- Recieves a message
- Parameters:
- message - the message to recieve
- See Also:
- MessageObserver
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
setDocumentBase
public void setDocumentBase(String documentBase)
- Sets the document base for resolving relative URLs
- Parameters:
- documentBase - the document base to use while processing.
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
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.
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.
setProperty
public void setProperty(String property,
String value)
- Sets the property value associated with the given String.
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