Constructor -- gets the node, its position, the node set it belongs to, and a parent context as arguments. The parent context is used to implement scoping rules for variables: if a variable is not found in the current context, it is looked for in the parent context, recursively. Except for node, all arguments have default values: default position is 0, default node set is the set that contains only the node, and the default parent is null.
Notice that position starts at 0 at the outside interface; inside XPath expressions this shows up as position()=1.
TODO
Optionalopt_position: numberTODO
Optionalopt_decimalFormatSettings: XsltDecimalFormatSettingsOptionalopt_variables: { [name: string]: any }Optionalopt_knownNamespaces: { [alias: string]: string }Optionalopt_parent: ExprContextTODO
Optionalopt_caseInsensitive: anyTODO
Optionalopt_ignoreAttributesWithoutValue: anyTODO
Optionalopt_returnOnFirstMatch: anyTODO
Optionalopt_ignoreNonElementNodesForNTA: anyTODO
Optionalopt_warningsCallback: (...args: any[]) => voidOptionalsystemCustom system properties for system-property() function. Overrides the default properties (xsl:version, xsl:vendor, xsl:vendor-url).
OptionaldocumentDocument loader function for the document() function. Takes a URI and returns an XNode document, or null if loading fails.
OptionalunparsedUnparsed entity URIs for the unparsed-entity-uri() function. Maps entity names to their URIs (from DTD declarations).
OptionalwarningsWarning callback for non-fatal XPath/XSLT warnings.
OptionalregexRegex groups from xsl:analyze-string for regex-group() function. Index 0 is the full match, 1+ are captured groups.
OptionalcurrentCurrent group from xsl:for-each-group for current-group() function. Contains the nodes/items in the current group being processed.
OptionalcurrentCurrent grouping key from xsl:for-each-group for current-grouping-key() function. Contains the key value of the current group being processed.
OptionaluserUser-defined XSLT functions from xsl:function declarations. Maps QName (namespace:localname) to function definition info.
clone() -- creates a new context with the current context as parent. If passed as argument to clone(), the new context has a different node, position, or node set. What is not passed is inherited from the cloned context.
Optionalopt_nodeList: XNode[]TODO
Optionalopt_position: numberTODO
TODO
Optionalname: stringOptionalvalue: string | NodeValueGets a regex group from xsl:analyze-string context. Searches up the parent chain for regexGroups.
Group index (0 = full match, 1+ = captured groups)
The group value or empty string if not found
XPath expression evaluation context. An XPath context consists of a DOM node, a list of DOM nodes that contains this node, a number that represents the position of the single node in the list, and a current set of variable bindings. (See XPath spec.)
setVariable(name, expr) -- binds given XPath expression to the name.
getVariable(name) -- what the name says.
setNode(position) -- sets the context to the node at the given position. Needed to implement scoping rules for variables in XPath. (A variable is visible to all subsequent siblings, not only to its children.)
set/isCaseInsensitive -- specifies whether node name tests should be case sensitive. If you're executing xpaths against a regular HTML DOM, you probably don't want case-sensitivity, because browsers tend to disagree about whether elements & attributes should be upper/lower case. If you're running xpaths in an XSLT instance, you probably DO want case sensitivity, as per the XSL spec.
set/isReturnOnFirstMatch -- whether XPath evaluation should quit as soon as a result is found. This is an optimization that might make sense if you only care about the first result.
set/isIgnoreNonElementNodesForNTA -- whether to ignore non-element nodes when evaluating the "node()" any node test. While technically this is contrary to the XPath spec, practically it can enhance performance significantly, and makes sense if you a) use "node()" when you mean "", and b) use "//" when you mean "/descendant:: /".