com.jclark.xsl.tr
Class ProcessContextImpl

java.lang.Object
  extended by com.jclark.xsl.tr.ProcessContextImpl
All Implemented Interfaces:
ExprContext, ProcessContext

 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
 
Nested classes/interfaces inherited from interface com.jclark.xsl.tr.ProcessContext
ProcessContext.Memento
 
Field Summary
(package private) static StringVariant emptyStringVariant
           
(package private) static int OPEN_ACTION_INIT_SIZE
           
 
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)
          binds a varaible to the given Name
 ProcessContext.Memento createMemento()
          save some state
 Result createNodeResult(Node baseNode, Node[] rootNodeRef)
           
 java.lang.Object get(java.lang.Object key)
           
 Node getCurrent(Node node)
           
 NodeIterator getDocument(java.net.URL baseURL, java.lang.String uriRef)
          load an object model representation of the XML document at a url constructed from the two arguments
 ExtensionContext getExtensionContext(java.lang.String namespace)
           
 Variant getGlobalVariableValue(Name name)
          access to the stylesheet's global variables
 KeyValuesTable getKeyValuesTable(Name keyName, Node contextNode)
           
 int getLastPosition()
           
 Variant getLocalVariableValue(Name name)
          access to the stylesheet's in-scope local variables
 Variant getParam(Name name)
           
 int getPosition()
           
 SaxFilterMaker getSaxExtensionFilter()
          returns an XRAP (Extension element) processor, packaged as a SAX filter
 Variant getSystemProperty(Name name)
          provides access to the system properties for the system-property() function in XSLT 1.0 section 12.4
 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(java.lang.Object key, java.lang.Object value)
           
 Name unaliasName(Name name)
           
 NamespacePrefixMap unaliasNamespacePrefixMap(NamespacePrefixMap map)
           
 void unbindLocalVariables(int n)
           
 void useAttributeSet(Name name, Node node, Result result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN_ACTION_INIT_SIZE

static final int OPEN_ACTION_INIT_SIZE
See Also:
Constant Field Values

emptyStringVariant

static StringVariant emptyStringVariant
Constructor Detail

ProcessContextImpl

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

invoke

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

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
Throws:
XSLException

processSafe

void processSafe(Node node,
                 Name name,
                 Result result)
           throws XSLException
Throws:
XSLException

applyImports

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

getPosition

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

getSaxExtensionFilter

public SaxFilterMaker getSaxExtensionFilter()
Description copied from interface: ProcessContext
returns an XRAP (Extension element) processor, packaged as a SAX filter

Specified by:
getSaxExtensionFilter in interface ProcessContext

getLastPosition

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

getGlobalVariableValue

public Variant getGlobalVariableValue(Name name)
                               throws XSLException
Description copied from interface: ExprContext
access to the stylesheet's global variables

Specified by:
getGlobalVariableValue in interface ExprContext
Throws:
XSLException

getLocalVariableValue

public Variant getLocalVariableValue(Name name)
Description copied from interface: ExprContext
access to the stylesheet's in-scope local variables

Specified by:
getLocalVariableValue in interface ExprContext

bindLocalVariable

public void bindLocalVariable(Name name,
                              Variant value)
                       throws XSLException
Description copied from interface: ProcessContext
binds a varaible to the given Name

Specified by:
bindLocalVariable in interface ProcessContext
Throws:
XSLException

unbindLocalVariables

public void unbindLocalVariables(int n)
Specified by:
unbindLocalVariables 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
Throws:
XSLException

getParam

public Variant getParam(Name name)
Specified by:
getParam in interface ProcessContext
Returns:
the parameter bound to the given name

createMemento

public ProcessContext.Memento createMemento()
save some state

Specified by:
createMemento in interface ProcessContext

getExtensionContext

public ExtensionContext getExtensionContext(java.lang.String namespace)
                                     throws XSLException
Specified by:
getExtensionContext in interface ExprContext
Throws:
XSLException

getSystemProperty

public Variant getSystemProperty(Name name)
Description copied from interface: ExprContext
provides access to the system properties for the system-property() function in XSLT 1.0 section 12.4

Specified by:
getSystemProperty in interface ExprContext

getCurrent

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

useAttributeSet

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

getDocument

public NodeIterator getDocument(java.net.URL baseURL,
                                java.lang.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
Throws:
XSLException

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

unaliasName

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

unaliasNamespacePrefixMap

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

put

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

get

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

getTree

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

createNodeResult

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