com.jclark.xsl.tr

Class SheetImpl

class SheetImpl extends Object implements SheetDetails, LoadContext, NamespaceConstants

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
NameATTRIBUTE
static NodeSetExprchildrenExpr
ImportancecurrentImportance
VariableSetcurrentLocalVariables
NameCASE_ORDER
NameCDATA_SECTION_ELEMENTS
NameCOUNT
NameDATA_TYPE
NameDEFAULT
NameDISABLE_OUTPUT_ESCAPING
NameDOCTYPE_PUBLIC
NameDOCTYPE_SYSTEM
static StringVariantemptyStringVariant
VectorexcludedNamespaces
ExtensionHandlerextensionHandler
NameELEMENTS
NameENCODING
NameEXCLUDE_RESULT_PREFIXES
NameFORMAT
NameFROM
NameGROUPING_SEPARATOR
NameGROUPING_SIZE
NameHREF
intimportCount
NameINDENT
NameLANG
NameLETTER_VALUE
NameLEVEL
NameMATCH
NameMEDIA_TYPE
NameMETHOD
NameMODE
NameTablenameTable
intnCurrentLocalVariables
NameNAME
NameNAMESPACE
NameOMIT_XML_DECLARATION
NameORDER
NamePRIORITY
NameRESULT_PREFIX
LoadContextsheetLoadContext
NameSELECT
NameSTANDALONE
NameSTYLESHEET_PREFIX
NameTERMINATE
NameTEST
NameUSE
NameUSE_ATTRIBUTE_SETS
NameVALUE
NameVERSION
NameXSL_ATTRIBUTE
NameXSL_FALLBACK
NameXSL_FOR_EACH
NameXSL_OTHERWISE
NameXSL_SORT
NameXSL_STYLESHEET
NameXSL_TRANSFORM
NameXSL_USE_ATTRIBUTE_SETS
NameXSL_VENDOR
NameXSL_VENDOR_URL
NameXSL_VERSION
NameXSL_WHEN
NameXSL_WITH_PARAM
XMLProcessor_omBuilder
SheetImpl.OutputMethodImpl_outputMethod
SheetImpl.OutputMethodImpl_runtimeOutputMethod
Constructor Summary
SheetImpl(Node node, XMLProcessor omBuilder, ExtensionHandler extensionHandler, LoadContext sheetLoadContext, NameTable nameTable)
The constructor builds (compiles) a stylesheet
Method Summary
ActionaddParams(ParamAction action, Node node)
voidclearOutputMethodProperties()
resets the output method to just those properties which were set in the stylesheet and/or defaults
ExtensionContextcreateExtensionContext(String namespace)
static NameexpandSourceElementTypeName(String nameString, Node node)
ActiongetAttributeSet(Name name)
StringgetData(Node node)
ActionDebugTargetgetDebugger()
gets the xrap processor for use during processing
VariableInfogetGlobalVariableInfo(Name name)
booleangetIncludeComments()
booleangetIncludeProcessingInstructions()
KeyDefinitiongetKeyDefinition(Name keyName)
obtain the definition of the named key
TemplateRuleSetgetModeTemplateRuleSet(Name modeName)
obtain the collection of templates which may be applied in a named Mode
StringgetNamespaceAlias(String ns)
NumberListFormatTemplategetNumberListFormatTemplate(Node node)
StringgetOptionalAttribute(Node node, Name name, String dflt)
OutputMethodgetOutputMethod()
returns the current values set either by client code, the stylesheet, or defaulted for the output method properties
PropertiesgetOutputMethodProperties()
returns the current values set either by client code, the stylesheet, or defaulted for the output method properties see java.xml.transform.Transform.getOutputMethodProperties()
StringgetOutputMethodProperty(String encodedPropertyNamespace, String encodedPropertyName)
returns the current value of the named property
StringgetPrefixNamespace(Node node, String prefix)
StringgetRequiredAttribute(Node node, Name name)
SaxFilterMakergetSaxExtensionFilter()
gets the xrap processor for use during processing
NodeSetExprgetSortNodeSetExpr(Node node, NodeSetExpr expr)
LoadContextgetSourceLoadContext()
booleangetStripSource(Name elementTypeName)
VariantgetSystemProperty(Name name)
VariantExprgetVariantExpr(Node defNode)
gets the value (an expression to be evaluated later) to be bound for a variable or parameter
booleanhaveNamespaceAliases()
ActionparseActions(Node node, Action ifEmpty)
ActionparseActions(Node node, Action ifEmpty, AppendAction sequence)
ActionparseAttributesAndActions(Node node)
Parse the attributes on node as literal attributes and then parse the actions.
voidparseTopLevel(Node sheetNode)
come here if we have a "xsl:stylesheet" root element expect XSLT elements permitted at the top level ... params, templates, keys, etc.
AppendActionparseUseAttributeSets(Node node, boolean literal, AppendAction sequence)
ActionparseUseAttributeSetsAndActions(Node node)
Resultprocess(Node node, XMLProcessor omBuilder, ParameterSet params, Result root)
process an XML input document against this stylesheet
voidsetDebugger(ActionDebugTarget debugger)
sets the xrap processor for use during processing
voidsetOutputMethodProperty(String encodedPropertyNamespace, String encodedPropertyName, String value)
override the stylesheet's or default value for an output method property
voidsetSaxExtensionFilter(SaxFilterMaker xrap)
sets the xrap processor for use during processing

Field Detail

ATTRIBUTE

Name ATTRIBUTE

childrenExpr

static NodeSetExpr childrenExpr

currentImportance

Importance currentImportance

currentLocalVariables

VariableSet currentLocalVariables

CASE_ORDER

Name CASE_ORDER

CDATA_SECTION_ELEMENTS

Name CDATA_SECTION_ELEMENTS

COUNT

Name COUNT

DATA_TYPE

Name DATA_TYPE

DEFAULT

Name DEFAULT

DISABLE_OUTPUT_ESCAPING

Name DISABLE_OUTPUT_ESCAPING

DOCTYPE_PUBLIC

Name DOCTYPE_PUBLIC

DOCTYPE_SYSTEM

Name DOCTYPE_SYSTEM

emptyStringVariant

static StringVariant emptyStringVariant

excludedNamespaces

Vector excludedNamespaces

extensionHandler

ExtensionHandler extensionHandler

ELEMENTS

Name ELEMENTS

ENCODING

Name ENCODING

EXCLUDE_RESULT_PREFIXES

Name EXCLUDE_RESULT_PREFIXES

FORMAT

Name FORMAT

FROM

Name FROM

GROUPING_SEPARATOR

Name GROUPING_SEPARATOR

GROUPING_SIZE

Name GROUPING_SIZE

HREF

Name HREF

importCount

int importCount

INDENT

Name INDENT

LANG

Name LANG

LETTER_VALUE

Name LETTER_VALUE

LEVEL

Name LEVEL

MATCH

Name MATCH

MEDIA_TYPE

Name MEDIA_TYPE

METHOD

Name METHOD

MODE

Name MODE

nameTable

NameTable nameTable

nCurrentLocalVariables

int nCurrentLocalVariables

NAME

Name NAME

NAMESPACE

Name NAMESPACE

OMIT_XML_DECLARATION

Name OMIT_XML_DECLARATION

ORDER

Name ORDER

PRIORITY

Name PRIORITY

RESULT_PREFIX

Name RESULT_PREFIX

sheetLoadContext

LoadContext sheetLoadContext

SELECT

Name SELECT

STANDALONE

Name STANDALONE

STYLESHEET_PREFIX

Name STYLESHEET_PREFIX

TERMINATE

Name TERMINATE

TEST

Name TEST

USE

Name USE

USE_ATTRIBUTE_SETS

Name USE_ATTRIBUTE_SETS

VALUE

Name VALUE

VERSION

Name VERSION

XSL_ATTRIBUTE

Name XSL_ATTRIBUTE

XSL_FALLBACK

Name XSL_FALLBACK

XSL_FOR_EACH

Name XSL_FOR_EACH

XSL_OTHERWISE

Name XSL_OTHERWISE

XSL_SORT

Name XSL_SORT

XSL_STYLESHEET

Name XSL_STYLESHEET

XSL_TRANSFORM

Name XSL_TRANSFORM

XSL_USE_ATTRIBUTE_SETS

Name XSL_USE_ATTRIBUTE_SETS

XSL_VENDOR

Name XSL_VENDOR

XSL_VENDOR_URL

Name XSL_VENDOR_URL

XSL_VERSION

Name XSL_VERSION

XSL_WHEN

Name XSL_WHEN

XSL_WITH_PARAM

Name XSL_WITH_PARAM

_omBuilder

XMLProcessor _omBuilder

_outputMethod

SheetImpl.OutputMethodImpl _outputMethod

_runtimeOutputMethod

SheetImpl.OutputMethodImpl _runtimeOutputMethod

Constructor Detail

SheetImpl

SheetImpl(Node node, XMLProcessor omBuilder, ExtensionHandler extensionHandler, LoadContext sheetLoadContext, NameTable nameTable)
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 Detail

addParams

Action addParams(ParamAction action, Node node)

clearOutputMethodProperties

public void clearOutputMethodProperties()
resets the output method to just those properties which were set in the stylesheet and/or defaults

createExtensionContext

public ExtensionContext createExtensionContext(String namespace)

expandSourceElementTypeName

static Name expandSourceElementTypeName(String nameString, Node node)

getAttributeSet

public Action getAttributeSet(Name name)

getData

String getData(Node node)

getDebugger

public ActionDebugTarget getDebugger()
gets the xrap processor for use during processing

getGlobalVariableInfo

public VariableInfo getGlobalVariableInfo(Name name)

getIncludeComments

public boolean getIncludeComments()

Returns: true

getIncludeProcessingInstructions

public boolean getIncludeProcessingInstructions()

Returns: true

getKeyDefinition

public KeyDefinition getKeyDefinition(Name keyName)
obtain the definition of the named key

getModeTemplateRuleSet

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

getNamespaceAlias

public String getNamespaceAlias(String ns)

getNumberListFormatTemplate

NumberListFormatTemplate getNumberListFormatTemplate(Node node)

getOptionalAttribute

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

getOutputMethod

public OutputMethod getOutputMethod()
returns the current values set either by client code, the stylesheet, or defaulted for the output method properties

getOutputMethodProperties

public Properties getOutputMethodProperties()
returns the current values set either by client code, the stylesheet, or defaulted for the output method properties see java.xml.transform.Transform.getOutputMethodProperties()

getOutputMethodProperty

public String getOutputMethodProperty(String encodedPropertyNamespace, String encodedPropertyName)
returns the current value of the named property

getPrefixNamespace

String getPrefixNamespace(Node node, String prefix)

Returns: the namespace URI reference for the given prefix in scope at the given Node

getRequiredAttribute

String getRequiredAttribute(Node node, Name name)

getSaxExtensionFilter

public SaxFilterMaker getSaxExtensionFilter()
gets the xrap processor for use during processing

getSortNodeSetExpr

NodeSetExpr getSortNodeSetExpr(Node node, NodeSetExpr expr)

getSourceLoadContext

public LoadContext getSourceLoadContext()

getStripSource

public boolean getStripSource(Name elementTypeName)

getSystemProperty

public Variant getSystemProperty(Name name)

getVariantExpr

VariantExpr getVariantExpr(Node defNode)
gets the value (an expression to be evaluated later) to be bound for a variable or parameter

haveNamespaceAliases

public boolean haveNamespaceAliases()

parseActions

Action parseActions(Node node, Action ifEmpty)

parseActions

Action parseActions(Node node, Action ifEmpty, AppendAction sequence)

parseAttributesAndActions

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

parseTopLevel

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

parseUseAttributeSets

AppendAction parseUseAttributeSets(Node node, boolean literal, AppendAction sequence)

parseUseAttributeSetsAndActions

Action parseUseAttributeSetsAndActions(Node node)

process

public Result process(Node node, XMLProcessor omBuilder, ParameterSet params, Result root)
process an XML input document against this stylesheet

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

setDebugger

public void setDebugger(ActionDebugTarget debugger)
sets the xrap processor for use during processing

setOutputMethodProperty

public void setOutputMethodProperty(String encodedPropertyNamespace, String encodedPropertyName, String value)
override the stylesheet's or default value for an output method property

setSaxExtensionFilter

public void setSaxExtensionFilter(SaxFilterMaker xrap)
sets the xrap processor for use during processing