\QueryPath\CSSSelector

A CSS Selector.

A CSS selector is made up of one or more Simple Selectors (SimpleSelector).

Summary

Methods
Properties
Constants
__construct()
getIterator()
toArray()
count()
elementID()
element()
elementNS()
anyElement()
anyElementInNS()
elementClass()
attribute()
attributeNS()
pseudoClass()
pseudoElement()
combinator()
directDescendant()
adjacent()
anotherSelector()
sibling()
anyDescendant()
No public properties found
No constants found
No protected methods found
$selectors
$currSelector
$selectorGroups
$groupIndex
N/A
No private methods found
No private properties found
N/A

Properties

$selectors

$selectors : 

Type

$currSelector

$currSelector : 

Type

$selectorGroups

$selectorGroups : 

Type

$groupIndex

$groupIndex : 

Type

Methods

__construct()

__construct() 

getIterator()

getIterator() 

toArray()

toArray() 

Get the array of SimpleSelector objects.

Normally, one iterates over a Selector. However, if it is necessary to get the selector array and manipulate it, this method can be used.

count()

count() 

elementID()

elementID(  $id) 

This event is fired when a CSS ID is encountered.

An ID begins with an octothorp: #name.

Parameters

$id

element()

element(  $name) 

Handle an element name.

Example: name

Parameters

$name

elementNS()

elementNS(  $name,   $namespace = NULL) 

Handle a namespaced element name.

example: namespace|name

Parameters

$name
$namespace

anyElement()

anyElement() 

Handle an any-element (*) operator.

Example: *

anyElementInNS()

anyElementInNS(  $ns) 

Handle an any-element operator that is constrained to a namespace.

Example: ns|*

Parameters

$ns

elementClass()

elementClass(  $name) 

Handle a CSS class selector.

Example: .name

Parameters

$name

attribute()

attribute(  $name,   $value = NULL,   $operation = \QueryPath\CSS\EventHandler::isExactly) 

Handle an attribute selector.

Example: [name=attr] Example: [name~=attr]

Parameters

$name
$value
$operation

attributeNS()

attributeNS(  $name,   $ns,   $value = NULL,   $operation = \QueryPath\CSS\EventHandler::isExactly) 

Handle an attribute selector bound to a specific namespace.

Example: [ns|name=attr] Example: [ns|name~=attr]

Parameters

$name
$ns
$value
$operation

pseudoClass()

pseudoClass(  $name,   $value = NULL) 

Handle a pseudo-class.

Example: :name(value)

Parameters

$name
$value

pseudoElement()

pseudoElement(  $name) 

Handle a pseudo-element.

Example: ::name

Parameters

$name

combinator()

combinator(  $combinatorName) 

Parameters

$combinatorName

directDescendant()

directDescendant() 

Handle a direct descendant combinator.

Example: >

adjacent()

adjacent() 

Handle a adjacent combinator.

Example: +

anotherSelector()

anotherSelector() 

Handle an another-selector combinator.

Example: ,

sibling()

sibling() 

Handle a sibling combinator.

Example: ~

anyDescendant()

anyDescendant() 

Handle an any-descendant combinator.

Example: ' '