All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xs.xs_XslEngine

java.lang.Object
   |
   +----xs.xs_XslEngine

public class xs_XslEngine
extends Object
The engine for applying an XSL stylesheet to an XML document. Given a pre-parsed XSL stylesheet and a pre-parsed XML document, it will generate the results.


Constructor Index

 o xs_XslEngine()
Default constructor - which simply ensures all XSL-related element classes are registered.

Method Index

 o applyStyle(xg_Document, xg_Document, JProgressBar)
Apply the style defined in the given stylesheet to the given source document, and write the results to the given writer.
 o applyStyle(xg_Document, xg_Document, Writer, JProgressBar)
Apply the style defined in the given stylesheet to the given source document, and write the results to the given writer.
 o checkDocuments(xg_Document, xg_Document)
Check that the given stylesheet and the given source document are suitable for applying the former to the latter.
 o ensureClassesRegistered()
Ensure the XSL-related element classes are registered.
 o registerElementClasses()

Register special types of element classes used to represent particular XSL constructs.

The present approach isn't ideal: it's static, so affects all XML parsing, and it doesn't permit the unregistering of all the special registrations.

Constructors

 o xs_XslEngine
 public xs_XslEngine()
Default constructor - which simply ensures all XSL-related element classes are registered.

Methods

 o ensureClassesRegistered
 public static void ensureClassesRegistered()
Ensure the XSL-related element classes are registered. That is, check to see if the first one is regstered, and if it isn't, register all of them.

 o registerElementClasses
 public static void registerElementClasses()

Register special types of element classes used to represent particular XSL constructs.

The present approach isn't ideal: it's static, so affects all XML parsing, and it doesn't permit the unregistering of all the special registrations.

 o applyStyle
 public String applyStyle(xg_Document InputStylesheetDocument,
                          xg_Document InputSourceDocument,
                          JProgressBar InputProgressBar) throws xs_StyleException
Apply the style defined in the given stylesheet to the given source document, and write the results to the given writer.

Parameters:
InputStylesheetDocument - Pre-parsed XSL stylesheet
InputSourceDocument - The pre-parsed source document
InputProgressBar - Bar on which to show progress (as measured by the end offset of each node after it is processed).
Returns:
A string representing the resulting document
Throws: xs_StyleException
Error applying style
 o applyStyle
 public void applyStyle(xg_Document InputStylesheetDocument,
                        xg_Document InputSourceDocument,
                        Writer OutputResultsWriter,
                        JProgressBar InputProgressBar) throws xs_StyleException
Apply the style defined in the given stylesheet to the given source document, and write the results to the given writer.

Parameters:
InputStylesheetDocument - Pre-parsed XSL stylesheet
InputSourceDocument - The pre-parsed source document
OutputResultsWriter - The results
InputProgressBar - Bar on which to show progress (as measured by the end offset of each node after it is processed).
Throws: xs_StyleException
Error applying style
 o checkDocuments
 public void checkDocuments(xg_Document InputStylesheetDocument,
                            xg_Document InputSourceDocument) throws xs_StyleException
Check that the given stylesheet and the given source document are suitable for applying the former to the latter. That is:

* They must not be null.

* They must each contain a root node which is not null.

* The stylesheet's root node must be of type 'xsl'.

Parameters:
InputStylesheetDocument - Pre-parsed XSL stylesheet
InputSourceDocument - The pre-parsed source document
Throws: xs_StyleException
One of the documents is unacceptable

All Packages  Class Hierarchy  This Package  Previous  Next  Index