com.jclark.xsl.tr

Class ProcessContextImpl

Implemented Interfaces:
ExprContext, ProcessContext

(package private) class ProcessContextImpl
extends java.lang.Object
implements ProcessContext

manages the state of a transformation (and performs the transformation of a source document against an XSLT stylesheet)

Nested Class Summary

(package private) static class
ProcessContextImpl.VariableBindings
variable name/value bindings are maintained internally as a linked list

Field Summary

(package private) static int
OPEN_ACTION_INIT_SIZE
(package private) static StringVariant
emptyStringVariant

Constructor Summary

ProcessContextImpl(SheetDetails sheet, Node root, XMLProcessor processor, ParameterSet params)

Method Summary

void
applyImports(Node node, Result result)
void
bindLocalVariable(Name name, Variant value)
ProcessContext.Memento
createMemento()
save some state
Result
createNodeResult(Node baseNode, Node[] rootNodeRef)
Object
get(Object key)
Node
getCurrent(Node node)
NodeIterator
getDocument(URL baseURL, String uriRef)
load an object model representation of the XML document at a url constructed from the two arguments
ExtensionContext
getExtensionContext(String namespace)
Variant
getGlobalVariableValue(Name name)
KeyValuesTable
getKeyValuesTable(Name keyName, Node contextNode)
int
getLastPosition()
Variant
getLocalVariableValue(Name name)
Variant
getParam(Name name)
int
getPosition()
SaxFilterMaker
getSaxExtensionFilter()
Variant
getSystemProperty(Name name)
Node
getTree(Variant variant)
void
invoke(NodeIterator iter, Action action, Result result)
void
invokeWithParams(Action action, Name[] paramNames, Variant[] paramValues, Node node, Result result)
void
process(NodeIterator iter, Name modeName, Name[] paramNames, Variant[] paramValues, Result result)
run the transformation
(package private) void
processSafe(Node node, Name name, Result result)
void
put(Object key, Object value)
Name
unaliasName(Name name)
NamespacePrefixMap
unaliasNamespacePrefixMap(NamespacePrefixMap map)
void
unbindLocalVariables(int n)
void
useAttributeSet(Name name, Node node, Result result)

Field Details

OPEN_ACTION_INIT_SIZE

(package private) static final int OPEN_ACTION_INIT_SIZE
Field Value:
2

emptyStringVariant

(package private) static StringVariant emptyStringVariant

Constructor Details

ProcessContextImpl

(package private)  ProcessContextImpl(SheetDetails sheet,
                                      Node root,
                                      XMLProcessor processor,
                                      ParameterSet params)

Method Details

applyImports

public void applyImports(Node node,
                         Result result)
            throws XSLException
Specified by:
applyImports in interface ProcessContext

bindLocalVariable

public void bindLocalVariable(Name name,
                              Variant value)
            throws XSLException
Specified by:
bindLocalVariable in interface ProcessContext

createMemento

public ProcessContext.Memento createMemento()
save some state
Specified by:
createMemento in interface ProcessContext

createNodeResult

public Result createNodeResult(Node baseNode,
                               Node[] rootNodeRef)
            throws XSLException
Specified by:
createNodeResult in interface ProcessContext

get

public Object get(Object key)
Specified by:
get in interface ProcessContext

getCurrent

public Node getCurrent(Node node)
Specified by:
getCurrent in interface ExprContext

getDocument

public NodeIterator getDocument(URL baseURL,
                                String uriRef)
            throws XSLException
load an object model representation of the XML document at a url constructed from the two arguments
Specified by:
getDocument in interface ExprContext

getExtensionContext

public ExtensionContext getExtensionContext(String namespace)
            throws XSLException
Specified by:
getExtensionContext in interface ExprContext

getGlobalVariableValue

public Variant getGlobalVariableValue(Name name)
            throws XSLException
Specified by:
getGlobalVariableValue in interface ExprContext

getKeyValuesTable

public KeyValuesTable getKeyValuesTable(Name keyName,
                                        Node contextNode)
Specified by:
getKeyValuesTable in interface ExprContext
Returns:
the table of indexed nodes for the named key in the node's document

getLastPosition

public int getLastPosition()
            throws XSLException
Specified by:
getLastPosition in interface ExprContext

getLocalVariableValue

public Variant getLocalVariableValue(Name name)
Specified by:
getLocalVariableValue in interface ExprContext

getParam

public Variant getParam(Name name)
Specified by:
getParam in interface ProcessContext

getPosition

public int getPosition()
Specified by:
getPosition in interface ExprContext

getSaxExtensionFilter

public SaxFilterMaker getSaxExtensionFilter()
Specified by:
getSaxExtensionFilter in interface ProcessContext

getSystemProperty

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

getTree

public Node getTree(Variant variant)
            throws XSLException
Specified by:
getTree in interface ExprContext

invoke

public void invoke(NodeIterator iter,
                   Action action,
                   Result result)
            throws XSLException
Specified by:
invoke in interface ProcessContext

invokeWithParams

public void invokeWithParams(Action action,
                             Name[] paramNames,
                             Variant[] paramValues,
                             Node node,
                             Result result)
            throws XSLException
Specified by:
invokeWithParams in interface ProcessContext

process

public void process(NodeIterator iter,
                    Name modeName,
                    Name[] paramNames,
                    Variant[] paramValues,
                    Result result)
            throws XSLException
run the transformation
Specified by:
process in interface ProcessContext

processSafe

(package private)  void processSafe(Node node,
                                    Name name,
                                    Result result)
            throws XSLException

put

public void put(Object key,
                Object value)
Specified by:
put in interface ProcessContext

unaliasName

public Name unaliasName(Name name)
Specified by:
unaliasName in interface ProcessContext

unaliasNamespacePrefixMap

public NamespacePrefixMap unaliasNamespacePrefixMap(NamespacePrefixMap map)
Specified by:
unaliasNamespacePrefixMap in interface ProcessContext

unbindLocalVariables

public void unbindLocalVariables(int n)
Specified by:
unbindLocalVariables in interface ProcessContext

useAttributeSet

public void useAttributeSet(Name name,
                            Node node,
                            Result result)
            throws XSLException
Specified by:
useAttributeSet in interface ProcessContext