This class is an implementation of XPathContext used when evaluating constant sub-expressions at
compile time.
changeOutputDestination
public void changeOutputDestination(Properties props,
Result result,
boolean isFinal,
int hostLanguage,
int validation,
SchemaType schemaType)
throws XPathException
Set a new output destination, supplying the output format details.
Note that it is the caller's responsibility to close the Writer after use.
- changeOutputDestination in interface XPathContext
props
- properties defining the output formatresult
- Details of the new output destinationisFinal
- true if the destination is a final result tree
(either the principal output or a secondary result tree); false if
it is a temporary tree, xsl:attribute, etc.hostLanguage
- the host language (XSLT, XQuery, XPath)
XPathException
- if any dynamic error occurs; and
specifically, if an attempt is made to switch to a final output
destination while writing a temporary tree or sequence
getCaller
public XPathContext getCaller()
Get the calling XPathContext (the next one down the stack). This will be null if unknown, or
if the bottom of the stack has been reached.
- getCaller in interface XPathContext
getContextItem
public Item getContextItem()
Get the context item
- getContextItem in interface XPathContext
- the context item, or null if the context item is undefined
getCurrentGroupIterator
public GroupIterator getCurrentGroupIterator()
Get the current group iterator. This supports the current-group() and
current-grouping-key() functions in XSLT 2.0
- getCurrentGroupIterator in interface XPathContext
- the current grouped collection
getCurrentIterator
public SequenceIterator getCurrentIterator()
Get the current iterator.
This encapsulates the context item, context position, and context size.
- getCurrentIterator in interface XPathContext
- the current iterator, or null if there is no current iterator
(which means the context item, position, and size are undefined).
getCurrentRegexIterator
public RegexIterator getCurrentRegexIterator()
Get the current regex iterator. This supports the functionality of the regex-group()
function in XSLT 2.0.
- getCurrentRegexIterator in interface XPathContext
- the current regular expressions iterator
getImplicitTimezone
public int getImplicitTimezone()
throws NoDynamicContextException
Get the implicit timezone, as a positive or negative offset from UTC in minutes.
The range is -14hours to +14hours. This implementation always throws a
NoDynamicContextException.
- getImplicitTimezone in interface XPathContext
- the implicit timezone, as an offset from UTC in minutes
getLocalParameters
public ParameterSet getLocalParameters()
Get the local (non-tunnel) parameters that were passed to the current function or template
- getLocalParameters in interface XPathContext
- a ParameterSet containing the local parameters
getStackFrame
public StackFrame getStackFrame()
Get a reference to the local stack frame for variables. Note that it's
the caller's job to make a local copy of this. This is used for creating
a Closure containing a retained copy of the variables for delayed evaluation.
- getStackFrame in interface XPathContext
getTunnelParameters
public ParameterSet getTunnelParameters()
Get the tunnel parameters that were passed to the current function or template. This includes all
active tunnel parameters whether the current template uses them or not.
- getTunnelParameters in interface XPathContext
- a ParameterSet containing the tunnel parameters
isAtLast
public boolean isAtLast()
throws XPathException
Determine whether the context position is the same as the context size
that is, whether position()=last()
- isAtLast in interface XPathContext
newContext
public XPathContextMajor newContext()
Construct a new context as a copy of another. The new context is effectively added
to the top of a stack, and contains a pointer to the previous context
- newContext in interface XPathContext
newMinorContext
public XPathContextMinor newMinorContext()
Construct a new minor context. A minor context can only hold new values of the focus
(currentIterator) and current output destination.
- newMinorContext in interface XPathContext
setOrigin
public void setOrigin(InstructionInfoProvider expr)
Set the creating expression (for use in diagnostics). The origin is generally set to "this" by the
object that creates the new context. It's up to the debugger to determine whether this information
is useful. Where possible, the object will be an
InstructionInfoProvider
, allowing information
about the calling instruction to be obtained.
- setOrigin in interface XPathContext
setTemporaryReceiver
public void setTemporaryReceiver(SequenceReceiver out)
Set the receiver to which output is to be written, marking it as a temporary (non-final)
output destination.
- setTemporaryReceiver in interface XPathContext
out
- The SequenceOutputter to be used
useLocalParameter
public boolean useLocalParameter(StructuredQName qName,
LocalParam binding,
boolean isTunnel)
throws XPathException
Use local parameter. This is called when a local xsl:param element is processed.
If a parameter of the relevant name was supplied, it is bound to the xsl:param element.
Otherwise the method returns false, so the xsl:param default will be evaluated
- useLocalParameter in interface XPathContext
qName
- The fingerprint of the parameter namebinding
- The XSLParam element to bind its value toisTunnel
- True if a tunnel parameter is required, else false
- true if a parameter of this name was supplied, false if not