public class ExperimentalXPathCompiler
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
allocateSlots(Expression exp,
int nextFree,
SlotManager frame)
Allocate slot numbers to range variables.
|
static void |
breakpoint(java.lang.String s)
Method that can be called from the XSLT code to trigger a debugger breakpoint
|
MapItem |
compileXPath(XPathContext context,
java.lang.String exprText,
NodeInfo sefElement,
MapItem localVariableMap,
NodeInfo nsAttribute)
Compile an XPath expression on behalf of the XX XSLT compiler
|
static SequenceType |
fromMap(MapItem typeAsMap)
Generate a SequenceType object from the map representation of a type
|
static ExperimentalXPathCompiler |
make(XPathContext context,
MapItem globalFunctions,
MapItem globalVariables) |
static MapItem |
makeMap(SequenceType st) |
static MapItem |
parseSequenceType(XPathContext context,
java.lang.String input,
NodeInfo nsContext,
java.lang.String xpathDefaultNamespace)
Parse a SequenceType
|
static void |
stackTrace(XPathContext context)
Method to output a stack trace
|
ExperimentalXPathCompiler |
withUniformStaticContext(XPathContext context,
NodeInfo sefElement,
NodeInfo nsAttribute) |
public static ExperimentalXPathCompiler make(XPathContext context, MapItem globalFunctions, MapItem globalVariables)
public ExperimentalXPathCompiler withUniformStaticContext(XPathContext context, NodeInfo sefElement, NodeInfo nsAttribute)
public MapItem compileXPath(XPathContext context, java.lang.String exprText, NodeInfo sefElement, MapItem localVariableMap, NodeInfo nsAttribute) throws XPathException
context
- the evaluation contextexprText
- the text of the XPath expressionsefElement
- the element node in the SEF tree containing the XPath expressionlocalVariableMap
- map containing information about local variables in the static context.
The key of the map is the name of the variable as a QName. The associated
value is a sequence of three items: the declaring element in the SEF
tree, the slot number, and the declared type of the variable.nsAttribute
- the nearest in-scope ns attribute, containing a whitespace-separated
list of prefix=uri namespace bindingsXPathException
- if XPath parsing fails with a static errorpublic static int allocateSlots(Expression exp, int nextFree, SlotManager frame)
ExpressionTool.allocateSlots(Expression, int, SlotManager)
,
which takes into account that variable references may have no target binding, and that some
variables will already have slot numbers.
This method is only concerned with allocating slot numbers to variables that are declared within the expression itself.
exp
- the expression whose range variables need to have slot numbers assignednextFree
- the next slot number that is available for allocationframe
- a SlotManager object that is used to track the mapping of slot numbers
to variable names for debugging purposes. May be null.public static void breakpoint(java.lang.String s)
s
- an identifying stringpublic static void stackTrace(XPathContext context)
public static MapItem parseSequenceType(XPathContext context, java.lang.String input, NodeInfo nsContext, java.lang.String xpathDefaultNamespace) throws XPathException
XPathException
public static MapItem makeMap(SequenceType st)
public static SequenceType fromMap(MapItem typeAsMap)
typeAsMap
- the type supplied as a mapCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.