    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.

##

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

##

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.
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.
checkDocuments(xg_Document, xg_Document)
  Check that the given stylesheet and the given source document are suitable for applying the former to the latter.
ensureClassesRegistered()
  Ensure the XSL-related element classes are registered.
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.

##

xs_XslEngine

     public xs_XslEngine()

  Default constructor - which simply ensures all XSL-related element classes are registered.

##

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.

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.

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

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

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