Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

WebLogic Server 6.0sp2 API Reference

## weblogic.apache.xalan.xpath
Class XPath

    java.lang.Object
      |
      +--weblogic.apache.xalan.xpath.XPath

public class XPath
extends java.lang.Object
implements java.io.Serializable

The XPath class represents the semantic parse tree of the XPath pattern. It is the representation of the grammar which filters out the choice for replacement order of the production rules. In order to conserve memory and reduce object creation, the tree is represented as an array of integers: [op code][length][...] where strings are represented within the array as indexes into the token tree.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Author:
  Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
  Serialized Form

Field Summary
`static int` | `ELEMWILDCARD` [ELEMWILDCARD] Means ELEMWILDCARD ("*"), used instead of string index in some places.
`static int` | `EMPTY` [EMPTY] Empty slot to indicate NULL.
`static int` | `ENDOP` [ENDOP] Some operators may like to have a terminator.
`static int` | `FROM_ANCESTORS` [FROM_stepType] [length, including predicates] [length of just the step, without the predicates] {node test} {predicates}? returns: XBoolean
`static int` | `FROM_ANCESTORS_OR_SELF`
`static int` | `FROM_ATTRIBUTES`
`static int` | `FROM_CHILDREN`
`static int` | `FROM_DESCENDANTS`
`static int` | `FROM_DESCENDANTS_OR_SELF`
`static int` | `FROM_FOLLOWING`
`static int` | `FROM_FOLLOWING_SIBLINGS`
`static int` | `FROM_NAMESPACE`
`static int` | `FROM_PARENT`
`static int` | `FROM_PRECEDING`
`static int` | `FROM_PRECEDING_SIBLINGS`
`static int` | `FROM_ROOT`
`static int` | `FROM_SELF`
`static int` | `FUNC_BOOLEAN`
`static int` | `FUNC_CEILING`
`static int` | `FUNC_CONCAT`
`static int` | `FUNC_CONTAINS`
`static int` | `FUNC_COUNT`
`static int` | `FUNC_CURRENT`
`static int` | `FUNC_DOCLOCATION`
`static int` | `FUNC_EXT_ELEM_AVAILABLE`
`static int` | `FUNC_EXT_FUNCTION_AVAILABLE`
`static int` | `FUNC_FALSE`
`static int` | `FUNC_FLOOR`
`static int` | `FUNC_GENERATE_ID`
`static int` | `FUNC_ID`
`static int` | `FUNC_KEY`
`static int` | `FUNC_LANG`
`static int` | `FUNC_LAST`
`static int` | `FUNC_LOCAL_PART`
`static int` | `FUNC_NAMESPACE`
`static int` | `FUNC_NORMALIZE_SPACE`
`static int` | `FUNC_NOT`
`static int` | `FUNC_NUMBER`
`static int` | `FUNC_POSITION`
`static int` | `FUNC_QNAME`
`static int` | `FUNC_ROUND`
`static int` | `FUNC_STARTS_WITH`
`static int` | `FUNC_STRING`
`static int` | `FUNC_STRING_LENGTH`
`static int` | `FUNC_SUBSTRING`
`static int` | `FUNC_SUBSTRING_AFTER`
`static int` | `FUNC_SUBSTRING_BEFORE`
`static int` | `FUNC_SUM`
`static int` | `FUNC_SYSTEM_PROPERTY`
`static int` | `FUNC_TRANSLATE`
`static int` | `FUNC_TRUE`
`static int` | `FUNC_UNPARSED_ENTITY_URI`
`static int` | `LOCATIONPATHEX_ISSIMPLE`
`static int` | `LOCATIONPATHEX_MASK`
`static int` | `MAPINDEX_LENGTH` The length is always the opcode position + 1.
`static int` | `MATCH_ANY_ANCESTOR` For match patterns.
`static int` | `MATCH_ATTRIBUTE` For match patterns.
`static int` | `MATCH_IMMEDIATE_ANCESTOR` For match patterns.
`static double` | `MATCH_SCORE_NODETEST` The match score if the pattern consists of just a NodeTest.
`static double` | `MATCH_SCORE_NONE` The match score if no match is made.
`static double` | `MATCH_SCORE_NSWILD` The match score if the pattern pattern has the form NCName:*.
`static double` | `MATCH_SCORE_OTHER` The match score if the pattern consists of something other than just a NodeTest or just a qname.
`static double` | `MATCH_SCORE_QNAME` The match score if the pattern has the form of a QName optionally preceded by an @ character.
`static int` | `NODENAME` [NODENAME] [index to ns token or EMPTY] [index to name token] returns: XBoolean
`static int` | `NODETYPE_ANYELEMENT` [NODETYPE_ANY] No size or arguments.
`static int` | `NODETYPE_COMMENT` [NODETYPE_COMMENT] No size or arguments.
`static int` | `NODETYPE_NODE` [NODETYPE_NODE] No size or arguments.
`static int` | `NODETYPE_PI` [NODETYPE_PI] [index to token] Note: must not overlap function OP number! returns: XBoolean
`static int` | `NODETYPE_ROOT` [NODETYPE_ROOT] No size or arguments.
`static int` | `NODETYPE_TEXT` [NODETYPE_TEXT] No size or arguments.
`static int` | `OP_AND` [OP_AND] [length] {boolean expression} {boolean expression} returns: XBoolean
`static int` | `OP_ARGUMENT` [OP_ARGUMENT] (Function argument.) [length] {expression} returns: XNodeSet XNumber XString XBoolean XRTree XObject
`static int` | `OP_BOOL` [OP_BOOL] (cast operation) [length] {expression} returns: XBoolean
`static int` | `OP_DIV` [OP_DIV] [length] {number expression} {number expression} returns: XNumber
`static int` | `OP_EQUALS` [OP_EQUALS] [length] {expression} {expression} returns: XBoolean
`static int` | `OP_EXTFUNCTION` [OP_EXTFUNCTION] (Extension function.) [length] [index to namespace token] [index to function name token] {OP_ARGUMENT}* returns: XNodeSet XNumber XString XBoolean XRTree XObject
`static int` | `OP_FUNCTION` [OP_FUNCTION] [length] [FUNC_name] {OP_ARGUMENT}* [ENDOP] returns: XNodeSet XNumber XString XBoolean XRTree XObject
`static int` | `OP_GROUP` [OP_GROUP] [length] {expression} returns: XNodeSet XNumber XString XBoolean XRTree XObject
`static int` | `OP_GT` [OP_GT] (greater-than) [length] {number expression} {number expression} returns: XBoolean
`static int` | `OP_GTE` [OP_GTE] (greater-than-or-equals) [length] {number expression} {number expression} returns: XBoolean
`static int` | `OP_LITERAL` [OP_LITERAL] [3] [index to token] returns: XString
`static int` | `OP_LOCATIONPATH` [OP_LOCATIONPATH] [length] {FROM_stepType} | {function}{predicate}* [ENDOP] (Note that element and attribute namespaces and names can be wildcarded '*'.) returns: XNodeSet
`static int` | `OP_LOCATIONPATH_EX`
`static int` | `OP_LOCATIONPATHPATTERN` [OP_UNION] [length] {PathExpr}+ returns: XNodeSet
`static int` | `OP_LT` [OP_LT] (less-than) [length] {number expression} {number expression} returns: XBoolean
`static int` | `OP_LTE` [OP_LTE] (less-than-or-equals) [length] {number expression} {number expression} returns: XBoolean
`static int` | `OP_MATCHPATTERN` [OP_UNION] [length] {PathExpr}+ returns: XNodeSet
`static int` | `OP_MINUS` [OP_MINUS] [length] {number expression} {number expression} returns: XNumber
`static int` | `OP_MOD` [OP_MOD] [length] {number expression} {number expression} returns: XNumber
`static int` | `OP_MULT` [OP_MULT] [length] {number expression} {number expression} returns: XNumber
`static int` | `OP_NEG` [OP_NEG] [length] {number expression} returns: XNumber
`static int` | `OP_NOTEQUALS` [OP_NOTEQUALS] [length] {expression} {expression} returns: XBoolean
`static int` | `OP_NUMBER` [OP_NUMBER] (cast operation) [length] {expression} returns: XBoolean
`static int` | `OP_NUMBERLIT` [OP_NUMBERLIT] (Number literal.) [3] [index to token] returns: XString
`static int` | `OP_OR` [OP_OR] [length] {boolean expression} {boolean expression} returns: XBoolean
`static int` | `OP_PLUS` [OP_PLUS] [length] {number expression} {number expression} returns: XNumber
`static int` | `OP_PREDICATE` [OP_PREDICATE] [length] {expression} [ENDOP] (For safety) returns: XBoolean or XNumber
`static int` | `OP_QUO` [OP_QUO] [length] {number expression} {number expression} returns: XNumber
`static int` | `OP_STRING` [OP_STRING] (cast operation) [length] {expression} returns: XString
`static int` | `OP_UNION` [OP_UNION] [length] {PathExpr}+ returns: XNodeSet
`static int` | `OP_VARIABLE` [OP_VARIABLE] [3] [index to token] returns: XString
`static int` | `OP_XPATH` [OP_XPATH] [length] {expression} returns: XNodeSet XNumber XString XBoolean XRTree XObject
`static java.lang.String` | `PSEUDONAME_ANY` used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.
`static java.lang.String` | `PSEUDONAME_COMMENT` used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.
`static java.lang.String` | `PSEUDONAME_OTHER` used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.
`static java.lang.String` | `PSEUDONAME_PI` used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.
`static java.lang.String` | `PSEUDONAME_ROOT` used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.
`static java.lang.String` | `PSEUDONAME_TEXT` used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

Constructor Summary
`XPath()` Construct an XPath object.
`XPath(ProblemListener problemListener)` Construct a XPath, passing in a problem listener.

Method Summary
`protected XBoolean` | `and(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` OR two expressions and return the boolean result.
`protected XObject` | `arg(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Execute a function argument.
`protected XBoolean` | `bool(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Cast an expression to a boolean.
`protected XNumber` | `div(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Divide a number.
`protected XBoolean` | `equals(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Tell if two expressions are functionally equal.
`XObject` | `execute(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Execute the XPath object from a given opcode position.
`XObject` | `execute(XPathSupport execContext, org.w3c.dom.Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo, boolean stopAtFirst)` Execute the XPath object from a given opcode position, calling back to a NodeCallback interface as the nodes are found.
`XObject` | `execute(XPathSupport execContext, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext)` Given an expression and a context, evaluate the XPath and return the result.
`XObject` | `execute(XPathSupport execContext, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext, NodeCallback callback, java.lang.Object callbackInfo, boolean stopAtFirst)` Given an expression and a context, evaluate the XPath and call the callback as nodes are found.
`protected XObject` | `extfunction(XPathSupport execContext, org.w3c.dom.Node context, int opPos, java.lang.String namespace, java.lang.String extensionName, java.util.Vector argVec, java.lang.Object methodKey)` Handle an extension function.
`int` | `getArgLengthOfStep(int opPos)` Go to the first child of a given operation.
`static int` | `getFirstChildPos(int opPos)` Go to the first child of a given operation.
`static int` | `getFirstChildPosOfStep(int opPos)` Go to the first child of a given operation.
`double` | `getMatchScore(XPathSupport execContext, org.w3c.dom.Node context)` Get the match score of the given node.
`int` | `getNextOpPos(int opPos)` Given an operation position, return the end position, i.e.
`static int` | `getNextOpPos(int[] opMap, int opPos)` Given an operation position, return the end position, i.e.
`int` | `getOp(int opPos)` Given an operation position, return the current op.
`int[]` | `getOpMap()` Get the opcode list that describes the XPath operations.
`java.lang.String` | `getPatternString()` Get the pattern string.
`ProblemListener` | `getProblemListener()` Get the problem listener property.
`java.util.Vector` | `getTargetElementStrings()` This method is for building indexes of match patterns for fast lookup.
`java.lang.Object[]` | `getTokenQueue()` Get the XPath as a list of tokens.
`int` | `getTokenQueueSize()` Get size of the token queue.
`protected XObject` | `group(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Execute an expression as a group.
`protected XBoolean` | `gt(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Tell if one argument is greater than the other argument.
`protected XBoolean` | `gte(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Tell if one argument is greater than or equal to the other argument.
`static int` | `installFunction(java.lang.String name, Function func)` Install a built-in function.
`void` | `installFunction(java.lang.String name, int funcIndex, Function func)` Install a built-in function.
`protected XString` | `literal(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Get a literal value.
`XNodeSet` | `locationPath(XPathSupport execContext, org.w3c.dom.Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo, boolean stopAtFirst)` Execute a location path.
`protected XNumber` | `locationPathPattern(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Execute a location path.
`protected XBoolean` | `lt(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Tell if one argument is less than the other argument.
`protected XBoolean` | `lte(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Tell if one argument is less than or equal to the other argument.
`protected XObject` | `matchPattern(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Computes the union of its operands which must be node-sets.
`protected XNumber` | `minus(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Give the difference of two arguments.
`protected XNumber` | `mod(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Return the remainder from a truncating division.
`protected XNumber` | `mult(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Multiply two arguments.
`protected XNumber` | `neg(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Return the negation of a number.
`protected XBoolean` | `notequals(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Tell if two expressions are functionally not equal.
`protected XNumber` | `number(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Cast an expression to a number.
`protected XNumber` | `numberlit(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Get a literal value.
`protected XBoolean` | `or(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` OR two expressions and return the boolean result.
`protected XNumber` | `plus(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Give the sum of two arguments.
`XObject` | `predicate(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Evaluate a predicate.
`protected XNumber` | `quo(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Return the remainder from a truncating division.
`void` | `setProblemListener(ProblemListener l)` Set the problem listener property.
`protected MutableNodeList` | `step(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Execute a step in a location path.
`protected XString` | `string(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Cast an expression to a string.
`protected XNodeSet` | `union(XPathSupport execContext, org.w3c.dom.Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo)` Computes the union of its operands which must be node-sets.
`protected XObject` | `variable(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Get a literal value.
`protected XObject` | `xpath(XPathSupport execContext, org.w3c.dom.Node context, int opPos)` Execute from the beginning of the xpath.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAPINDEX_LENGTH

    public static final int MAPINDEX_LENGTH

  The length is always the opcode position + 1. Length is always expressed as the opcode+length bytes, so it is always 2 or greater.

### MATCH_SCORE_NONE

    public static final double MATCH_SCORE_NONE

  The match score if no match is made.

### MATCH_SCORE_QNAME

    public static final double MATCH_SCORE_QNAME

  The match score if the pattern has the form of a QName optionally preceded by an @ character.

### MATCH_SCORE_NSWILD

    public static final double MATCH_SCORE_NSWILD

  The match score if the pattern pattern has the form NCName:*.

### MATCH_SCORE_NODETEST

    public static final double MATCH_SCORE_NODETEST

  The match score if the pattern consists of just a NodeTest.

### MATCH_SCORE_OTHER

    public static final double MATCH_SCORE_OTHER

  The match score if the pattern consists of something other than just a NodeTest or just a qname.

### ENDOP

    public static final int ENDOP

  [ENDOP] Some operators may like to have a terminator.

### EMPTY

    public static final int EMPTY

  [EMPTY] Empty slot to indicate NULL.

### ELEMWILDCARD

    public static final int ELEMWILDCARD

  [ELEMWILDCARD] Means ELEMWILDCARD ("*"), used instead of string index in some places.

### OP_XPATH

    public static final int OP_XPATH

  [OP_XPATH] [length] {expression} returns: XNodeSet XNumber XString XBoolean XRTree XObject

### OP_OR

    public static final int OP_OR

  [OP_OR] [length] {boolean expression} {boolean expression} returns: XBoolean

### OP_AND

    public static final int OP_AND

  [OP_AND] [length] {boolean expression} {boolean expression} returns: XBoolean

### OP_NOTEQUALS

    public static final int OP_NOTEQUALS

  [OP_NOTEQUALS] [length] {expression} {expression} returns: XBoolean

### OP_EQUALS

    public static final int OP_EQUALS

  [OP_EQUALS] [length] {expression} {expression} returns: XBoolean

### OP_LTE

    public static final int OP_LTE

  [OP_LTE] (less-than-or-equals) [length] {number expression} {number expression} returns: XBoolean

### OP_LT

    public static final int OP_LT

  [OP_LT] (less-than) [length] {number expression} {number expression} returns: XBoolean

### OP_GTE

    public static final int OP_GTE

  [OP_GTE] (greater-than-or-equals) [length] {number expression} {number expression} returns: XBoolean

### OP_GT

    public static final int OP_GT

  [OP_GT] (greater-than) [length] {number expression} {number expression} returns: XBoolean

### OP_PLUS

    public static final int OP_PLUS

  [OP_PLUS] [length] {number expression} {number expression} returns: XNumber

### OP_MINUS

    public static final int OP_MINUS

  [OP_MINUS] [length] {number expression} {number expression} returns: XNumber

### OP_MULT

    public static final int OP_MULT

  [OP_MULT] [length] {number expression} {number expression} returns: XNumber

### OP_DIV

    public static final int OP_DIV

  [OP_DIV] [length] {number expression} {number expression} returns: XNumber

### OP_MOD

    public static final int OP_MOD

  [OP_MOD] [length] {number expression} {number expression} returns: XNumber

### OP_QUO

    public static final int OP_QUO

  [OP_QUO] [length] {number expression} {number expression} returns: XNumber

### OP_NEG

    public static final int OP_NEG

  [OP_NEG] [length] {number expression} returns: XNumber

### OP_STRING

    public static final int OP_STRING

  [OP_STRING] (cast operation) [length] {expression} returns: XString

### OP_BOOL

    public static final int OP_BOOL

  [OP_BOOL] (cast operation) [length] {expression} returns: XBoolean

### OP_NUMBER

    public static final int OP_NUMBER

  [OP_NUMBER] (cast operation) [length] {expression} returns: XBoolean

### OP_UNION

    public static final int OP_UNION

  [OP_UNION] [length] {PathExpr}+ returns: XNodeSet

### OP_LITERAL

    public static final int OP_LITERAL

  [OP_LITERAL] [3] [index to token] returns: XString

### OP_VARIABLE

    public static final int OP_VARIABLE

  [OP_VARIABLE] [3] [index to token] returns: XString

### OP_GROUP

    public static final int OP_GROUP

  [OP_GROUP] [length] {expression} returns: XNodeSet XNumber XString XBoolean XRTree XObject

### OP_NUMBERLIT

    public static final int OP_NUMBERLIT

  [OP_NUMBERLIT] (Number literal.) [3] [index to token] returns: XString

### OP_ARGUMENT

    public static final int OP_ARGUMENT

  [OP_ARGUMENT] (Function argument.) [length] {expression} returns: XNodeSet XNumber XString XBoolean XRTree XObject

### OP_EXTFUNCTION

    public static final int OP_EXTFUNCTION

  [OP_EXTFUNCTION] (Extension function.) [length] [index to namespace token] [index to function name token] {OP_ARGUMENT}* returns: XNodeSet XNumber XString XBoolean XRTree XObject

### OP_FUNCTION

    public static final int OP_FUNCTION

  [OP_FUNCTION] [length] [FUNC_name] {OP_ARGUMENT}* [ENDOP] returns: XNodeSet XNumber XString XBoolean XRTree XObject

### OP_LOCATIONPATH

    public static final int OP_LOCATIONPATH

  [OP_LOCATIONPATH] [length] {FROM_stepType} | {function}{predicate}* [ENDOP] (Note that element and attribute namespaces and names can be wildcarded '*'.) returns: XNodeSet

### LOCATIONPATHEX_MASK

    public static final int LOCATIONPATHEX_MASK

### LOCATIONPATHEX_ISSIMPLE

    public static final int LOCATIONPATHEX_ISSIMPLE

### OP_LOCATIONPATH_EX

    public static final int OP_LOCATIONPATH_EX

### OP_PREDICATE

    public static final int OP_PREDICATE

  [OP_PREDICATE] [length] {expression} [ENDOP] (For safety) returns: XBoolean or XNumber

### OP_MATCHPATTERN

    public static final int OP_MATCHPATTERN

  [OP_UNION] [length] {PathExpr}+ returns: XNodeSet

### OP_LOCATIONPATHPATTERN

    public static final int OP_LOCATIONPATHPATTERN

  [OP_UNION] [length] {PathExpr}+ returns: XNodeSet

### NODETYPE_COMMENT

    public static final int NODETYPE_COMMENT

  [NODETYPE_COMMENT] No size or arguments. Note: must not overlap function OP number! returns: XBoolean

### NODETYPE_TEXT

    public static final int NODETYPE_TEXT

  [NODETYPE_TEXT] No size or arguments. Note: must not overlap function OP number! returns: XBoolean

### NODETYPE_PI

    public static final int NODETYPE_PI

  [NODETYPE_PI] [index to token] Note: must not overlap function OP number! returns: XBoolean

### NODETYPE_NODE

    public static final int NODETYPE_NODE

  [NODETYPE_NODE] No size or arguments. Note: must not overlap function OP number! returns: XBoolean

### NODENAME

    public static final int NODENAME

  [NODENAME] [index to ns token or EMPTY] [index to name token] returns: XBoolean

### NODETYPE_ROOT

    public static final int NODETYPE_ROOT

  [NODETYPE_ROOT] No size or arguments. returns: XBoolean

### NODETYPE_ANYELEMENT

    public static final int NODETYPE_ANYELEMENT

  [NODETYPE_ANY] No size or arguments. returns: XBoolean

### FROM_ANCESTORS

    public static final int FROM_ANCESTORS

  [FROM_stepType] [length, including predicates] [length of just the step, without the predicates] {node test} {predicates}? returns: XBoolean

### FROM_ANCESTORS_OR_SELF

    public static final int FROM_ANCESTORS_OR_SELF

### FROM_ATTRIBUTES

    public static final int FROM_ATTRIBUTES

### FROM_CHILDREN

    public static final int FROM_CHILDREN

### FROM_DESCENDANTS

    public static final int FROM_DESCENDANTS

### FROM_DESCENDANTS_OR_SELF

    public static final int FROM_DESCENDANTS_OR_SELF

### FROM_FOLLOWING

    public static final int FROM_FOLLOWING

### FROM_FOLLOWING_SIBLINGS

    public static final int FROM_FOLLOWING_SIBLINGS

### FROM_PARENT

    public static final int FROM_PARENT

### FROM_PRECEDING

    public static final int FROM_PRECEDING

### FROM_PRECEDING_SIBLINGS

    public static final int FROM_PRECEDING_SIBLINGS

### FROM_SELF

    public static final int FROM_SELF

### FROM_NAMESPACE

    public static final int FROM_NAMESPACE

### FROM_ROOT

    public static final int FROM_ROOT

### FUNC_CURRENT

    public static final int FUNC_CURRENT

### FUNC_LAST

    public static final int FUNC_LAST

### FUNC_POSITION

    public static final int FUNC_POSITION

### FUNC_COUNT

    public static final int FUNC_COUNT

### FUNC_ID

    public static final int FUNC_ID

### FUNC_KEY

    public static final int FUNC_KEY

### FUNC_LOCAL_PART

    public static final int FUNC_LOCAL_PART

### FUNC_NAMESPACE

    public static final int FUNC_NAMESPACE

### FUNC_QNAME

    public static final int FUNC_QNAME

### FUNC_GENERATE_ID

    public static final int FUNC_GENERATE_ID

### FUNC_NOT

    public static final int FUNC_NOT

### FUNC_TRUE

    public static final int FUNC_TRUE

### FUNC_FALSE

    public static final int FUNC_FALSE

### FUNC_BOOLEAN

    public static final int FUNC_BOOLEAN

### FUNC_NUMBER

    public static final int FUNC_NUMBER

### FUNC_FLOOR

    public static final int FUNC_FLOOR

### FUNC_CEILING

    public static final int FUNC_CEILING

### FUNC_ROUND

    public static final int FUNC_ROUND

### FUNC_SUM

    public static final int FUNC_SUM

### FUNC_STRING

    public static final int FUNC_STRING

### FUNC_STARTS_WITH

    public static final int FUNC_STARTS_WITH

### FUNC_CONTAINS

    public static final int FUNC_CONTAINS

### FUNC_SUBSTRING_BEFORE

    public static final int FUNC_SUBSTRING_BEFORE

### FUNC_SUBSTRING_AFTER

    public static final int FUNC_SUBSTRING_AFTER

### FUNC_NORMALIZE_SPACE

    public static final int FUNC_NORMALIZE_SPACE

### FUNC_TRANSLATE

    public static final int FUNC_TRANSLATE

### FUNC_CONCAT

    public static final int FUNC_CONCAT

### FUNC_SUBSTRING

    public static final int FUNC_SUBSTRING

### FUNC_STRING_LENGTH

    public static final int FUNC_STRING_LENGTH

### FUNC_SYSTEM_PROPERTY

    public static final int FUNC_SYSTEM_PROPERTY

### FUNC_LANG

    public static final int FUNC_LANG

### FUNC_EXT_FUNCTION_AVAILABLE

    public static final int FUNC_EXT_FUNCTION_AVAILABLE

### FUNC_EXT_ELEM_AVAILABLE

    public static final int FUNC_EXT_ELEM_AVAILABLE

### FUNC_DOCLOCATION

    public static final int FUNC_DOCLOCATION

### FUNC_UNPARSED_ENTITY_URI

    public static final int FUNC_UNPARSED_ENTITY_URI

### MATCH_ATTRIBUTE

    public static final int MATCH_ATTRIBUTE

  For match patterns.

### MATCH_ANY_ANCESTOR

    public static final int MATCH_ANY_ANCESTOR

  For match patterns.

### MATCH_IMMEDIATE_ANCESTOR

    public static final int MATCH_IMMEDIATE_ANCESTOR

  For match patterns.

### PSEUDONAME_ANY

    public static final java.lang.String PSEUDONAME_ANY

  used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

### PSEUDONAME_ROOT

    public static final java.lang.String PSEUDONAME_ROOT

  used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

### PSEUDONAME_TEXT

    public static final java.lang.String PSEUDONAME_TEXT

  used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

### PSEUDONAME_COMMENT

    public static final java.lang.String PSEUDONAME_COMMENT

  used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

### PSEUDONAME_PI

    public static final java.lang.String PSEUDONAME_PI

  used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

### PSEUDONAME_OTHER

    public static final java.lang.String PSEUDONAME_OTHER

  used mainly for keys in the pattern lookup table, for those nodes that don't have unique lookup values.

Constructor Detail

### XPath

    public XPath(ProblemListener problemListener)

  Construct a XPath, passing in a problem listener. The object must be initialized by the XPathProcessorImpl.initXPath method.

  Parameters:
    `problemListener` - An interface whereby the caller can listen for errors and warnings.

### XPath

    public XPath()

  Construct an XPath object. The object must be initialized by the XPathProcessorImpl.initXPath method.

Method Detail

### getPatternString

    public java.lang.String getPatternString()

  Get the pattern string.

### getTokenQueue

    public java.lang.Object[] getTokenQueue()

  Get the XPath as a list of tokens.

### getTokenQueueSize

    public int getTokenQueueSize()

  Get size of the token queue.

### getOpMap

    public int[] getOpMap()

  Get the opcode list that describes the XPath operations. It contains operations codes and indexes into the m_tokenQueue. I use an array instead of a full parse tree in order to cut down on the number of objects created.

### setProblemListener

    public void setProblemListener(ProblemListener l)

  Set the problem listener property. This class can have a single listener that can be informed of errors and warnings, and can normally control if an exception is thrown or not (or the problem listeners can throw their own RuntimeExceptions).

  Parameters:
    `l` - A ProblemListener interface.

### getProblemListener

    public ProblemListener getProblemListener()

  Get the problem listener property. This class can have a single listener that can be informed of errors and warnings, and can normally control if an exception is thrown or not (or the problem listeners can throw their own RuntimeExceptions).

  Returns:
    A ProblemListener interface.

### execute

    public XObject execute(XPathSupport execContext,
                           org.w3c.dom.Node contextNode,
                           PrefixResolver namespaceContext)
                    throws org.xml.sax.SAXException

  Given an expression and a context, evaluate the XPath and return the result.

  Parameters:
    `execContext` - The execution context.
    `contextNode` - The node that "." expresses.
    `namespaceContext` - The context in which namespaces in the XPath are supposed to be expanded.
  Throws:
    SAXException - thrown if the active ProblemListener decides the error condition is severe enough to halt processing.

### execute

    public XObject execute(XPathSupport execContext,
                           org.w3c.dom.Node contextNode,
                           PrefixResolver namespaceContext,
                           NodeCallback callback,
                           java.lang.Object callbackInfo,
                           boolean stopAtFirst)
                    throws org.xml.sax.SAXException

  Given an expression and a context, evaluate the XPath and call the callback as nodes are found. Only some simple types of expresions right now can call back, so if this method returns null, then the callbacks have been called, otherwise a valid XObject will be returned.

  Parameters:
    `execContext` - The execution context.
    `contextNode` - The node that "." expresses.
    `namespaceContext` - The context in which namespaces in the XPath are supposed to be expanded.
    `callback` - Interface that implements the processLocatedNode method.
    `callbackInfo` - Object that will be passed to the processLocatedNode method.
    `stopAtFirst` - True if the search should stop once the first node in document order is found.
  Returns:
    The result of the XPath or null if callbacks are used.
  Throws:
    SAXException - thrown if the active ProblemListener decides the error condition is severe enough to halt processing.
    SAXException - thrown if the error condition is severe enough to halt processing.

### getMatchScore

    public double getMatchScore(XPathSupport execContext,
                                org.w3c.dom.Node context)
                         throws org.xml.sax.SAXException

  Get the match score of the given node.

  Parameters:
    `context` - The current source tree context node.

### installFunction

    public void installFunction(java.lang.String name,
                                int funcIndex,
                                Function func)

  Install a built-in function.

  Parameters:
    `name` - The unqualified name of the function.
    `funcIndex` - The index of the function in the table.
    `func` - A Implementation of an XPath Function object.
  Returns:
    the position of the function in the internal index.

### installFunction

    public static int installFunction(java.lang.String name,
                                      Function func)

  Install a built-in function.

  Parameters:
    `name` - The unqualified name of the function.
    `func` - A Implementation of an XPath Function object.
  Returns:
    the position of the function in the internal index.

### xpath

    protected XObject xpath(XPathSupport execContext,
                            org.w3c.dom.Node context,
                            int opPos)
                     throws org.xml.sax.SAXException

  Execute from the beginning of the xpath.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### or

    protected XBoolean or(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  OR two expressions and return the boolean result.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### and

    protected XBoolean and(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos)
                    throws org.xml.sax.SAXException

  OR two expressions and return the boolean result.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### notequals

    protected XBoolean notequals(XPathSupport execContext,
                                 org.w3c.dom.Node context,
                                 int opPos)
                          throws org.xml.sax.SAXException

  Tell if two expressions are functionally not equal.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### equals

    protected XBoolean equals(XPathSupport execContext,
                              org.w3c.dom.Node context,
                              int opPos)
                       throws org.xml.sax.SAXException

  Tell if two expressions are functionally equal.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### lte

    protected XBoolean lte(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos)
                    throws org.xml.sax.SAXException

  Tell if one argument is less than or equal to the other argument.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### lt

    protected XBoolean lt(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Tell if one argument is less than the other argument.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### gte

    protected XBoolean gte(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos)
                    throws org.xml.sax.SAXException

  Tell if one argument is greater than or equal to the other argument.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### gt

    protected XBoolean gt(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Tell if one argument is greater than the other argument.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### plus

    protected XNumber plus(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos)
                    throws org.xml.sax.SAXException

  Give the sum of two arguments.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### minus

    protected XNumber minus(XPathSupport execContext,
                            org.w3c.dom.Node context,
                            int opPos)
                     throws org.xml.sax.SAXException

  Give the difference of two arguments.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### mult

    protected XNumber mult(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos)
                    throws org.xml.sax.SAXException

  Multiply two arguments.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### div

    protected XNumber div(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Divide a number.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### mod

    protected XNumber mod(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Return the remainder from a truncating division.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### quo

    protected XNumber quo(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Return the remainder from a truncating division. (Quo is no longer supported by xpath).

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### neg

    protected XNumber neg(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Return the negation of a number.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### string

    protected XString string(XPathSupport execContext,
                             org.w3c.dom.Node context,
                             int opPos)
                      throws org.xml.sax.SAXException

  Cast an expression to a string.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### bool

    protected XBoolean bool(XPathSupport execContext,
                            org.w3c.dom.Node context,
                            int opPos)
                     throws org.xml.sax.SAXException

  Cast an expression to a boolean.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### number

    protected XNumber number(XPathSupport execContext,
                             org.w3c.dom.Node context,
                             int opPos)
                      throws org.xml.sax.SAXException

  Cast an expression to a number.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### union

    protected XNodeSet union(XPathSupport execContext,
                             org.w3c.dom.Node context,
                             int opPos,
                             NodeCallback callback,
                             java.lang.Object callbackInfo)
                      throws org.xml.sax.SAXException

  Computes the union of its operands which must be node-sets.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.
    `callback` - Interface that implements the processLocatedNode method.
    `callbackInfo` - Object that will be passed to the processLocatedNode method.

### literal

    protected XString literal(XPathSupport execContext,
                              org.w3c.dom.Node context,
                              int opPos)

  Get a literal value.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### variable

    protected XObject variable(XPathSupport execContext,
                               org.w3c.dom.Node context,
                               int opPos)
                        throws org.xml.sax.SAXException

  Get a literal value.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### group

    protected XObject group(XPathSupport execContext,
                            org.w3c.dom.Node context,
                            int opPos)
                     throws org.xml.sax.SAXException

  Execute an expression as a group.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### numberlit

    protected XNumber numberlit(XPathSupport execContext,
                                org.w3c.dom.Node context,
                                int opPos)

  Get a literal value.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### arg

    protected XObject arg(XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos)
                   throws org.xml.sax.SAXException

  Execute a function argument.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### locationPath

    public XNodeSet locationPath(XPathSupport execContext,
                                 org.w3c.dom.Node context,
                                 int opPos,
                                 NodeCallback callback,
                                 java.lang.Object callbackInfo,
                                 boolean stopAtFirst)
                          throws org.xml.sax.SAXException

  Execute a location path.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.
    `callback` - Interface that implements the processLocatedNode method.
    `callbackInfo` - Object that will be passed to the processLocatedNode method.

### predicate

    public XObject predicate(XPathSupport execContext,
                             org.w3c.dom.Node context,
                             int opPos)
                      throws org.xml.sax.SAXException

  Evaluate a predicate.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### step

    protected MutableNodeList step(XPathSupport execContext,
                                   org.w3c.dom.Node context,
                                   int opPos)
                            throws org.xml.sax.SAXException

  Execute a step in a location path. This must be implemented by a derived class of XPath (or don't call at all from the derived implementation of locationPath()).

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### extfunction

    protected XObject extfunction(XPathSupport execContext,
                                  org.w3c.dom.Node context,
                                  int opPos,
                                  java.lang.String namespace,
                                  java.lang.String extensionName,
                                  java.util.Vector argVec,
                                  java.lang.Object methodKey)
                           throws org.xml.sax.SAXException

  Handle an extension function.

### matchPattern

    protected XObject matchPattern(XPathSupport execContext,
                                   org.w3c.dom.Node context,
                                   int opPos)
                            throws org.xml.sax.SAXException

  Computes the union of its operands which must be node-sets.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### locationPathPattern

    protected XNumber locationPathPattern(XPathSupport execContext,
                                          org.w3c.dom.Node context,
                                          int opPos)
                                   throws org.xml.sax.SAXException

  Execute a location path.

  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### getTargetElementStrings

    public java.util.Vector getTargetElementStrings()

  This method is for building indexes of match patterns for fast lookup. This allows a caller to get the name or type of a node, and quickly find the likely candidates that may match.

### execute

    public XObject execute(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos)
                    throws org.xml.sax.SAXException

  Execute the XPath object from a given opcode position.

  Parameters:
    `execContext` - The execution context.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.
    `callback` - Interface that implements the processLocatedNode method.
    `callbackInfo` - Object that will be passed to the processLocatedNode method.
  Returns:
    The result of the XPath.

### execute

    public XObject execute(XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos,
                           NodeCallback callback,
                           java.lang.Object callbackInfo,
                           boolean stopAtFirst)
                    throws org.xml.sax.SAXException

  Execute the XPath object from a given opcode position, calling back to a NodeCallback interface as the nodes are found. This will return null if the path is simple enough for callbacks to be used, otherwise it will return an XObject.

  Parameters:
    `execContext` - The execution context.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.
    `callback` - Interface that implements the processLocatedNode method.
    `callbackInfo` - Object that will be passed to the processLocatedNode method.
  Returns:
    The result of the XPath or null if callbacks are used.

### getOp

    public int getOp(int opPos)

  Given an operation position, return the current op.

  Returns:
    position of next operation in m_opMap.

### getNextOpPos

    public int getNextOpPos(int opPos)

  Given an operation position, return the end position, i.e. the beginning of the next operation.

  Returns:
    position of next operation in m_opMap.

### getNextOpPos

    public static int getNextOpPos(int[] opMap,
                                   int opPos)

  Given an operation position, return the end position, i.e. the beginning of the next operation.

  Returns:
    position of next operation in m_opMap.

### getFirstChildPos

    public static int getFirstChildPos(int opPos)

  Go to the first child of a given operation.

### getArgLengthOfStep

    public int getArgLengthOfStep(int opPos)

  Go to the first child of a given operation.

### getFirstChildPosOfStep

    public static int getFirstChildPosOfStep(int opPos)

  Go to the first child of a given operation.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs60
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD