Spec-Zone.ru › Symfony 4.0

Переводчик

класс Переводчик реализует TranslatorInterface

Интерфейс перевода выражений XPath.

Этот компонент является портом Python-библиотеки cssselect, авторские права которой принадлежат Ian Bicking, см. https://github.com/SimonSapin/cssselect.

Методы

__construct(ParserInterface $parser = null)
static getXpathLiteral(string $element)
cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::')

Переводит CSS-селектор в выражение XPath.

selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::')

Переводит узел разобранного селектора в выражение XPath.

registerExtension(ExtensionInterface $extension)
getExtension(string $name)
registerParserShortcut(ParserInterface $shortcut)
nodeToXPath(NodeInterface $node)
addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath)
addFunction(XPathExpr $xpath, FunctionNode $function)
addPseudoClass(XPathExpr $xpath, string $pseudoClass)
addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, $value)

Детали

__construct(ParserInterface $parser = null)

Параметры

ParserInterface $parser

static getXpathLiteral(string $element)

Параметры

string $element

cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::')

Переводит CSS-селектор в выражение XPath.

Параметры

string $cssExpr
string $prefix

selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::')

Переводит узел разобранного селектора в выражение XPath.

Параметры

SelectorNode $selector
string $prefix

registerExtension(ExtensionInterface $extension)

Параметры

ExtensionInterface $extension

getExtension(string $name)

Параметры

string $name

Исключения

ExpressionErrorException

registerParserShortcut(ParserInterface $shortcut)

Параметры

ParserInterface $shortcut

nodeToXPath(NodeInterface $node)

Параметры

NodeInterface $node

Исключения

ExpressionErrorException

addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath)

Параметры

string $combiner
NodeInterface $xpath
NodeInterface $combinedXpath

Исключения

ExpressionErrorException

addFunction(XPathExpr $xpath, FunctionNode $function)

Параметры

XPathExpr $xpath
FunctionNode $function

Исключения

ExpressionErrorException

addPseudoClass(XPathExpr $xpath, string $pseudoClass)

Параметры

XPathExpr $xpath
string $pseudoClass

Исключения

ExpressionErrorException

addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, $value)

Параметры

XPathExpr $xpath
string $operator
string $attribute
$value

Исключения

ExpressionErrorException

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/CssSelector/XPath/Translator.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API