com.jclark.xsl.tr

Class SheetImpl

Implemented Interfaces:
LoadContext, Sheet, SheetDetails

(package private) class SheetImpl
extends java.lang.Object
implements SheetDetails, LoadContext

Actually does the work of compiling the stylesheet's object model into the template rules, actions, variable definitions, etc. The constructor compiles the stylesheet, the method "process()" runs the transformation

Field Summary

(package private) Name
ATTRIBUTE
(package private) Name
CASE_ORDER
(package private) Name
CDATA_SECTION_ELEMENTS
(package private) Name
COUNT
(package private) Name
DATA_TYPE
(package private) Name
DEFAULT
(package private) Name
DISABLE_OUTPUT_ESCAPING
(package private) Name
ELEMENTS
(package private) Name
EXCLUDE_RESULT_PREFIXES
(package private) Name
FORMAT
(package private) Name
FROM
(package private) Name
GROUPING_SEPARATOR
(package private) Name
GROUPING_SIZE
(package private) Name
HREF
(package private) Name
LANG
(package private) Name
LETTER_VALUE
(package private) Name
LEVEL
(package private) Name
MATCH
(package private) Name
METHOD
(package private) Name
MODE
(package private) Name
NAME
(package private) Name
NAMESPACE
(package private) Name
ORDER
(package private) Name
PRIORITY
(package private) Name
RESULT_PREFIX
(package private) Name
SELECT
(package private) Name
STYLESHEET_PREFIX
(package private) Name
TERMINATE
(package private) Name
TEST
(package private) Name
USE
(package private) Name
USE_ATTRIBUTE_SETS
(package private) Name
VALUE
(package private) static String
XFYXT_NAMESPACE
(package private) Name
XSL_ATTRIBUTE
(package private) Name
XSL_FALLBACK
(package private) Name
XSL_FOR_EACH
(package private) static String
XSL_NAMESPACE
(package private) Name
XSL_OTHERWISE
(package private) Name
XSL_SORT
(package private) Name
XSL_STYLESHEET
(package private) Name
XSL_TRANSFORM
(package private) Name
XSL_USE_ATTRIBUTE_SETS
(package private) Name
XSL_VENDOR
(package private) Name
XSL_VENDOR_URL
(package private) Name
XSL_VERSION
(package private) Name
XSL_WHEN
(package private) Name
XSL_WITH_PARAM
(package private) static String
XT_NAMESPACE
(package private) XMLProcessor
_omBuilder
(package private) static NodeSetExpr
childrenExpr
(package private) Importance
currentImportance
(package private) VariableSet
currentLocalVariables
(package private) static StringVariant
emptyStringVariant
(package private) Vector
excludedNamespaces
(package private) ExtensionHandler
extensionHandler
(package private) Importance
firstImportImportance
(package private) int
nCurrentLocalVariables
(package private) NameTable
nameTable
(package private) com.jclark.xsl.tr.SheetImpl.OutputMethodImpl
outputMethod
(package private) LoadContext
sheetLoadContext

Constructor Summary

SheetImpl(Node node, XMLProcessor omBuilder, ExtensionHandler extensionHandler, LoadContext sheetLoadContext, NameTable nameTable)
The constructor builds (compiles) a stylesheet

Method Summary

(package private) Action
addParams(ParamAction action, Node node)
ExtensionContext
createExtensionContext(String namespace)
(package private) static Name
expandSourceElementTypeName(String nameString, Node node)
Action
getAttributeSet(Name name)
(package private) String
getData(Node node)
VariableInfo
getGlobalVariableInfo(Name name)
boolean
getIncludeComments()
boolean
getIncludeProcessingInstructions()
KeyDefinition
getKeyDefinition(Name keyName)
obtain the definition of the named key
TemplateRuleSet
getModeTemplateRuleSet(Name modeName)
obtain the collection of templates which may be applied in a named Mode
String
getNamespaceAlias(String ns)
(package private) NumberListFormatTemplate
getNumberListFormatTemplate(Node node)
(package private) String
getOptionalAttribute(Node node, Name name, String dflt)
(package private) String
getPrefixNamespace(Node node, String prefix)
(package private) String
getRequiredAttribute(Node node, Name name)
SaxFilterMaker
getSaxExtensionFilter()
gets the xrap processor for use during processing
(package private) NodeSetExpr
getSortNodeSetExpr(Node node, NodeSetExpr expr)
LoadContext
getSourceLoadContext()
boolean
getStripSource(Name elementTypeName)
Variant
getSystemProperty(Name name)
(package private) VariantExpr
getVariantExpr(Node defNode)
gets the value for a variable or parameter
boolean
haveNamespaceAliases()
(package private) Action
parseActions(Node node, Action ifEmpty)
(package private) Action
parseActions(Node node, Action ifEmpty, AppendAction sequence)
(package private) Action
parseAttributesAndActions(Node node)
Parse the attributes on node as literal attributes and then parse the actions.
(package private) void
parseTopLevel(Node sheetNode)
come here if we have a "stylesheet" root element expect XSLT elements permitted at the top level ...
(package private) AppendAction
parseUseAttributeSets(Node node, boolean literal, AppendAction sequence)
(package private) Action
parseUseAttributeSetsAndActions(Node node)
Result
process(Node node, XMLProcessor omBuilder, ParameterSet params, Result root)
process an XML input document against this stylesheet
void
setSaxExtensionFilter(SaxFilterMaker xrap)
sets the xrap processor for use during processing

Field Details

ATTRIBUTE

(package private)  Name ATTRIBUTE

CASE_ORDER

(package private)  Name CASE_ORDER

CDATA_SECTION_ELEMENTS

(package private)  Name CDATA_SECTION_ELEMENTS

COUNT

(package private)  Name COUNT

DATA_TYPE

(package private)  Name DATA_TYPE

DEFAULT

(package private)  Name DEFAULT

DISABLE_OUTPUT_ESCAPING

(package private)  Name DISABLE_OUTPUT_ESCAPING

ELEMENTS

(package private)  Name ELEMENTS

EXCLUDE_RESULT_PREFIXES

(package private)  Name EXCLUDE_RESULT_PREFIXES

FORMAT

(package private)  Name FORMAT

FROM

(package private)  Name FROM

GROUPING_SEPARATOR

(package private)  Name GROUPING_SEPARATOR

GROUPING_SIZE

(package private)  Name GROUPING_SIZE

HREF

(package private)  Name HREF

LANG

(package private)  Name LANG

LETTER_VALUE

(package private)  Name LETTER_VALUE

LEVEL

(package private)  Name LEVEL

MATCH

(package private)  Name MATCH

METHOD

(package private)  Name METHOD

MODE

(package private)  Name MODE

NAME

(package private)  Name NAME

NAMESPACE

(package private)  Name NAMESPACE

ORDER

(package private)  Name ORDER

PRIORITY

(package private)  Name PRIORITY

RESULT_PREFIX

(package private)  Name RESULT_PREFIX

SELECT

(package private)  Name SELECT

STYLESHEET_PREFIX

(package private)  Name STYLESHEET_PREFIX

TERMINATE

(package private)  Name TERMINATE

TEST

(package private)  Name TEST

USE

(package private)  Name USE

USE_ATTRIBUTE_SETS

(package private)  Name USE_ATTRIBUTE_SETS

VALUE

(package private)  Name VALUE

XFYXT_NAMESPACE

(package private) static final String XFYXT_NAMESPACE

XSL_ATTRIBUTE

(package private)  Name XSL_ATTRIBUTE

XSL_FALLBACK

(package private)  Name XSL_FALLBACK

XSL_FOR_EACH

(package private)  Name XSL_FOR_EACH

XSL_NAMESPACE

(package private) static final String XSL_NAMESPACE

XSL_OTHERWISE

(package private)  Name XSL_OTHERWISE

XSL_SORT

(package private)  Name XSL_SORT

XSL_STYLESHEET

(package private)  Name XSL_STYLESHEET

XSL_TRANSFORM

(package private)  Name XSL_TRANSFORM

XSL_USE_ATTRIBUTE_SETS

(package private)  Name XSL_USE_ATTRIBUTE_SETS

XSL_VENDOR

(package private)  Name XSL_VENDOR

XSL_VENDOR_URL

(package private)  Name XSL_VENDOR_URL

XSL_VERSION

(package private)  Name XSL_VERSION

XSL_WHEN

(package private)  Name XSL_WHEN

XSL_WITH_PARAM

(package private)  Name XSL_WITH_PARAM

XT_NAMESPACE

(package private) static final String XT_NAMESPACE

_omBuilder

(package private)  XMLProcessor _omBuilder

childrenExpr

(package private) static NodeSetExpr childrenExpr

currentImportance

(package private)  Importance currentImportance

currentLocalVariables

(package private)  VariableSet currentLocalVariables

emptyStringVariant

(package private) static StringVariant emptyStringVariant

excludedNamespaces

(package private)  Vector excludedNamespaces

extensionHandler

(package private)  ExtensionHandler extensionHandler

firstImportImportance

(package private)  Importance firstImportImportance

nCurrentLocalVariables

(package private)  int nCurrentLocalVariables

nameTable

(package private)  NameTable nameTable

outputMethod

(package private)  com.jclark.xsl.tr.SheetImpl.OutputMethodImpl outputMethod

sheetLoadContext

(package private)  LoadContext sheetLoadContext

Constructor Details

SheetImpl

(package private)  SheetImpl(Node node,
                             XMLProcessor omBuilder,
                             ExtensionHandler extensionHandler,
                             LoadContext sheetLoadContext,
                             NameTable nameTable)
            throws IOException,
                   XSLException
The constructor builds (compiles) a stylesheet
Parameters:
node - the (xslt D) OM root Node of the loaded stylesheet
omBuilder - a (xslt D) OM builder we can use for included/imported sheets
extensionHandler - for extensions?
sheetLoadContext - ??
nameTable - ??

Method Details

addParams

(package private)  Action addParams(ParamAction action,
                                    Node node)
            throws XSLException

createExtensionContext

public ExtensionContext createExtensionContext(String namespace)
            throws XSLException
Specified by:
createExtensionContext in interface SheetDetails

expandSourceElementTypeName

(package private) static Name expandSourceElementTypeName(String nameString,
                                                          Node node)
            throws XSLException

getAttributeSet

public Action getAttributeSet(Name name)
Specified by:
getAttributeSet in interface SheetDetails

getData

(package private)  String getData(Node node)
            throws XSLException

getGlobalVariableInfo

public VariableInfo getGlobalVariableInfo(Name name)
Specified by:
getGlobalVariableInfo in interface SheetDetails

getIncludeComments

public boolean getIncludeComments()
Specified by:
getIncludeComments in interface LoadContext
Returns:
true

getIncludeProcessingInstructions

public boolean getIncludeProcessingInstructions()
Specified by:
getIncludeProcessingInstructions in interface LoadContext
Returns:
true

getKeyDefinition

public KeyDefinition getKeyDefinition(Name keyName)
obtain the definition of the named key
Specified by:
getKeyDefinition in interface SheetDetails

getModeTemplateRuleSet

public TemplateRuleSet getModeTemplateRuleSet(Name modeName)
obtain the collection of templates which may be applied in a named Mode
Specified by:
getModeTemplateRuleSet in interface SheetDetails

getNamespaceAlias

public String getNamespaceAlias(String ns)
Specified by:
getNamespaceAlias in interface SheetDetails

getNumberListFormatTemplate

(package private)  NumberListFormatTemplate getNumberListFormatTemplate(Node node)
            throws XSLException

getOptionalAttribute

(package private)  String getOptionalAttribute(Node node,
                                               Name name,
                                               String dflt)

getPrefixNamespace

(package private)  String getPrefixNamespace(Node node,
                                             String prefix)
            throws XSLException
Returns:
the namespace URI reference for the given prefix in scope at the given Node

getRequiredAttribute

(package private)  String getRequiredAttribute(Node node,
                                               Name name)
            throws XSLException

getSaxExtensionFilter

public SaxFilterMaker getSaxExtensionFilter()
gets the xrap processor for use during processing
Specified by:
getSaxExtensionFilter in interface Sheet

getSortNodeSetExpr

(package private)  NodeSetExpr getSortNodeSetExpr(Node node,
                                                  NodeSetExpr expr)
            throws XSLException

getSourceLoadContext

public LoadContext getSourceLoadContext()
Specified by:
getSourceLoadContext in interface Sheet

getStripSource

public boolean getStripSource(Name elementTypeName)
Specified by:
getStripSource in interface LoadContext

getSystemProperty

public Variant getSystemProperty(Name name)
Specified by:
getSystemProperty in interface SheetDetails

getVariantExpr

(package private)  VariantExpr getVariantExpr(Node defNode)
            throws XSLException
gets the value for a variable or parameter

haveNamespaceAliases

public boolean haveNamespaceAliases()
Specified by:
haveNamespaceAliases in interface SheetDetails

parseActions

(package private)  Action parseActions(Node node,
                                       Action ifEmpty)
            throws XSLException

parseActions

(package private)  Action parseActions(Node node,
                                       Action ifEmpty,
                                       AppendAction sequence)
            throws XSLException

parseAttributesAndActions

(package private)  Action parseAttributesAndActions(Node node)
            throws XSLException
Parse the attributes on node as literal attributes and then parse the actions.

parseTopLevel

(package private)  void parseTopLevel(Node sheetNode)
            throws XSLException,
                   IOException
come here if we have a "stylesheet" root element expect XSLT elements permitted at the top level ... params, templates, keys, etc.

parseUseAttributeSets

(package private)  AppendAction parseUseAttributeSets(Node node,
                                                      boolean literal,
                                                      AppendAction sequence)
            throws XSLException

parseUseAttributeSetsAndActions

(package private)  Action parseUseAttributeSetsAndActions(Node node)
            throws XSLException

process

public Result process(Node node,
                      XMLProcessor omBuilder,
                      ParameterSet params,
                      Result root)
            throws XSLException
process an XML input document against this stylesheet
Specified by:
process in interface Sheet
Parameters:
node - the source document
omBuilder - an object model builder we can (re-)use for e.g. "document()"
params - the XSLT run-time parameters
root - the destination for thetransformation results

setSaxExtensionFilter

public void setSaxExtensionFilter(SaxFilterMaker xrap)
sets the xrap processor for use during processing
Specified by:
setSaxExtensionFilter in interface Sheet