This class represents a minor change in the dynamic context in which an XPath expression is evaluated:
a "major context" object allows all aspects of the dynamic context to change, whereas
a "minor context" only allows changes to the focus and the destination for push output.
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.
This affects all further output until resetOutputDestination() is called. 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 ifhostLanguage
- the host language, for example Configuration.XSLT
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 final 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 final Item getContextItem()
Get the context item
- getContextItem in interface XPathContext
- the context item, or null if the context item is undefined
getContextPosition
public final int getContextPosition()
throws XPathException
Get the context position (the position of the context item)
- getContextPosition in interface XPathContext
- the context position (starting at one)
getCurrentDateTime
public DateTimeValue getCurrentDateTime()
Get the current date and time for this query or transformation.
All calls during one transformation return the same answer.
- getCurrentDateTime in interface XPathContext
- Get the current date and time. This will deliver the same value
for repeated calls within the same transformation
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 final 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 final int getImplicitTimezone()
Get the implicit timezone, as a positive or negative offset from UTC in minutes.
The range is -14hours to +14hours
- getImplicitTimezone in interface XPathContext
- the implicit timezone as an offset from UTC in minutes
getLast
public final int getLast()
throws XPathException
Get the context size (the position of the last item in the current node list)
- getLast in interface XPathContext
getNameChecker
public final NameChecker getNameChecker()
Get a NameChecker for checking names against the XML 1.0 or XML 1.1 specification as appropriate
- the appropriate name checker
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
isAtLast
public final 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
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 output destination to write to a sequence.
This affects all further output until resetOutputDestination() is called.
- setTemporaryReceiver in interface XPathContext
out
- The SequenceReceiver 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