abstract class XPathHelper

Methods

static string
decodeStrings(string $expr)

Decode strings inside of an XPath expression

static string
encodeStrings(string $expr)

Encode strings inside of an XPath expression

static array
getVariables(string $expr)

Return the list of variables used in a given XPath expression

static bool
isExpressionNumeric(string $expr)

Determine whether given XPath expression definitely evaluates to a number

static string
minify(string $expr)

Remove extraneous space in a given XPath expression

static string
removeRedundantParentheses(string $expr)

Remove consecutive parentheses where redundant

static array|false
parseEqualityExpr(string $expr)

Parse an XPath expression that is composed entirely of equality tests between a variable part and a constant part

static string
evaluateConcat(string $expr)

Evaluate a concat() expression where all arguments are string literals

static string
evaluateLiteral(string $expr)

Evaluate an XPath literal

static RecursiveParser
getXPathParser()

Generate and return a cached XPath parser with a default set of matchers

Details

at line 28
static string decodeStrings(string $expr)

Decode strings inside of an XPath expression

Parameters

string $expr

Return Value

string

at line 46
static string encodeStrings(string $expr)

Encode strings inside of an XPath expression

Parameters

string $expr

Return Value

string

at line 64
static array getVariables(string $expr)

Return the list of variables used in a given XPath expression

Parameters

string $expr

XPath expression

Return Value

array

Alphabetically sorted list of unique variable names

at line 85
static bool isExpressionNumeric(string $expr)

Determine whether given XPath expression definitely evaluates to a number

Parameters

string $expr

XPath expression

Return Value

bool

Whether given XPath expression definitely evaluates to a number

at line 112
static string minify(string $expr)

Remove extraneous space in a given XPath expression

Parameters

string $expr

Original XPath expression

Return Value

string

Minified XPath expression

at line 159
static protected string removeRedundantParentheses(string $expr)

Remove consecutive parentheses where redundant

Parameters

string $expr

Return Value

string

at line 192
static array|false parseEqualityExpr(string $expr)

Parse an XPath expression that is composed entirely of equality tests between a variable part and a constant part

Parameters

string $expr

Return Value

array|false

at line 236
static protected string evaluateConcat(string $expr)

Evaluate a concat() expression where all arguments are string literals

Parameters

string $expr

concat() expression

Return Value

string

Expression's value

at line 255
static protected string evaluateLiteral(string $expr)

Evaluate an XPath literal

Parameters

string $expr

XPath literal

Return Value

string

Literal's string value

at line 270
static protected RecursiveParser getXPathParser()

Generate and return a cached XPath parser with a default set of matchers

Return Value

RecursiveParser