class XPath

Constants

ALPHANUMERIC

NUMERIC

LETTERS

EXTENDED_ALPHANUMERIC

SINGLE_QUOTE

DOUBLE_QUOTE

ALL_QUOTES

Methods

static string
filterAttrValue(string $value, string $quotes = self::ALL_QUOTES)

Filter an attribute value for save inclusion in an XPath query.

static string
filterAttrName(string $name, mixed $allow = self::EXTENDED_ALPHANUMERIC)

Filter an attribute name for save inclusion in an XPath query.

Details

at line 27
static string filterAttrValue(string $value, string $quotes = self::ALL_QUOTES)

Filter an attribute value for save inclusion in an XPath query.

Parameters

string $value The value to filter.
string $quotes The quotes used to delimit the value in the XPath query.

Return Value

string The filtered attribute value.

at line 42
static string filterAttrName(string $name, mixed $allow = self::EXTENDED_ALPHANUMERIC)

Filter an attribute name for save inclusion in an XPath query.

Parameters

string $name The attribute name to filter.
mixed $allow The set of characters to allow. Can be one of the constants provided by this class, or a custom regex excluding the '#' character (used as delimiter).

Return Value

string The filtered attribute name.