class NodeExtension extends AbstractExtension

XPath expression translator node extension.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect.

Constants

ELEMENT_NAME_IN_LOWER_CASE

ATTRIBUTE_NAME_IN_LOWER_CASE

ATTRIBUTE_VALUE_IN_LOWER_CASE

Methods

callable[]
getNodeTranslators()

Returns node translators.

callable[]
getCombinationTranslators()

Returns combination translators.

callable[]
getFunctionTranslators()

Returns function translators.

callable[]
getPseudoClassTranslators()

Returns pseudo-class translators.

callable[]
getAttributeMatchingTranslators()

Returns attribute operation translators.

__construct(int $flags = 0)

No description

$this
setFlag(int $flag, bool $on)

No description

bool
hasFlag(int $flag)

No description

translateSelector(SelectorNode $node, Translator $translator)

No description

translateNegation(NegationNode $node, Translator $translator)

No description

translateFunction(FunctionNode $node, Translator $translator)

No description

translatePseudo(PseudoNode $node, Translator $translator)

No description

translateAttribute(AttributeNode $node, Translator $translator)

No description

translateClass(ClassNode $node, Translator $translator)

No description

translateHash(HashNode $node, Translator $translator)

No description

translateElement(ElementNode $node)

No description

string
getName()

Returns extension name.

Details

callable[] getNodeTranslators()

Returns node translators.

These callables will receive the node as first argument and the translator as second argument.

Return Value

callable[]

callable[] getCombinationTranslators()

Returns combination translators.

Return Value

callable[]

callable[] getFunctionTranslators()

Returns function translators.

Return Value

callable[]

callable[] getPseudoClassTranslators()

Returns pseudo-class translators.

Return Value

callable[]

callable[] getAttributeMatchingTranslators()

Returns attribute operation translators.

Return Value

callable[]

__construct(int $flags = 0)

Parameters

int $flags

$this setFlag(int $flag, bool $on)

Parameters

int $flag
bool $on

Return Value

$this

bool hasFlag(int $flag)

Parameters

int $flag

Return Value

bool

XPathExpr translateSelector(SelectorNode $node, Translator $translator)

Parameters

SelectorNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateCombinedSelector(CombinedSelectorNode $node, Translator $translator)

Parameters

CombinedSelectorNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateNegation(NegationNode $node, Translator $translator)

Parameters

NegationNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateFunction(FunctionNode $node, Translator $translator)

Parameters

FunctionNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translatePseudo(PseudoNode $node, Translator $translator)

Parameters

PseudoNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateAttribute(AttributeNode $node, Translator $translator)

Parameters

AttributeNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateClass(ClassNode $node, Translator $translator)

Parameters

ClassNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateHash(HashNode $node, Translator $translator)

Parameters

HashNode $node
Translator $translator

Return Value

XPathExpr

XPathExpr translateElement(ElementNode $node)

Parameters

ElementNode $node

Return Value

XPathExpr

string getName()

Returns extension name.

Return Value

string