Interface CssEventHandler

(line 31)

Description


Located in File: /src/QueryPath/CssParser.php

An event handler for handling CSS 3 Selector parsing.

This provides a standard interface for CSS 3 Selector event handling. As the parser parses a selector, it will fire events. Implementations of CssEventHandler can then handle the events.

This library is inspired by the SAX2 API for parsing XML. Each component of a selector fires an event, passing the necessary data on to the event handler.



Class Variables

Summary:

Class Constants

Summary:

anyElement = '*' (line 45)

The any-element operator (*).

beginsWith = 4 (line 41)

The begins-with operator (^=).

containsInString = 3 (line 39)

The contains-in-string operator (*=).

containsWithHyphen = 2 (line 37)

The contains-with-hyphen operator (!=).

containsWithSpace = 1 (line 35)

The contains-with-space operator (~=).

endsWith = 5 (line 43)

The ends-with operator ($=).

isExactly = 0 (line 33)

The is-exactly (=) operator.

Method Detail

Summary:
void adjacent ()
void anotherSelector ()
void anyDescendant ()
void anyElement ()
void anyElementInNS (string $ns)
void attribute (string $name, [string $value = NULL], [int $operation = CssEventHandler::isExactly])
void attributeNS (string $name,  $ns, [string $value = NULL], [int $operation = CssEventHandler::isExactly], string $namespace)
void element (string $name)
void elementClass (string $name)
void elementID (string $id)
void elementNS (string $name, [string $namespace = NULL])
void pseudoClass (string $name, [string $value = NULL])
void pseudoElement (string $name)
void sibling ()

Method adjacent (line 143)

void adjacent( )

Handle a adjacent combinator.

Example: +

Info

  • access - public

Method anotherSelector (line 148)

void anotherSelector( )

Handle an another-selector combinator.

Example: ,

Info

  • access - public

Method anyDescendant (line 158)

void anyDescendant( )

Handle an any-descendant combinator.

Example: ' '

Info

  • access - public

Method anyElement (line 75)

void anyElement( )

Handle an any-element (*) operator.

Example: *

Info

  • access - public

Method anyElementInNS (line 82)

void anyElementInNS( string $ns)

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

Example: ns|*

Parameters

  • string $ns: The namespace identifier (not the URI).

Info

  • access - public

Method attribute (line 102)

void attribute( string $name, [string $value = NULL], [int $operation = CssEventHandler::isExactly])

Handle an attribute selector.

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

Parameters

  • string $name: The attribute name.
  • string $value: The value of the attribute, if given.
  • int $operation: The operation to be used for matching. See CssEventHandler constants for a list of supported operations.

Info

  • access - public

Method attributeNS (line 117)

void attributeNS( string $name, $ns, [string $value = NULL], [int $operation = CssEventHandler::isExactly], string $namespace)

Handle an attribute selector bound to a specific namespace.

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

Parameters

  • string $name: The attribute name.
  • string $value: The value of the attribute, if given.
  • int $operation: The operation to be used for matching. See CssEventHandler constants for a list of supported operations.
  • string $namespace: The namespace identifier (not the URI).
  • $ns:

Info

  • access - public

Method directDescendant (line 138)

void directDescendant( )

Handle a direct descendant combinator.

Example: >

Info

  • access - public

Method element (line 61)

void element( string $name)

Handle an element name.

Example: name

Parameters

  • string $name: The name of the element.

Info

  • access - public

Method elementClass (line 89)

void elementClass( string $name)

Handle a CSS class selector.

Example: .name

Parameters

  • string $name: The name of the class.

Info

  • access - public

Method elementID (line 54)

void elementID( string $id)

This event is fired when a CSS ID is encountered.

An ID begins with an octothorp: #name.

Parameters

  • string $id: The ID passed in.

Info

  • access - public

Method elementNS (line 70)

void elementNS( string $name, [string $namespace = NULL])

Handle a namespaced element name.

example: namespace|name

Parameters

  • string $name: The tag name.
  • string $namespace: The namespace identifier (Not the URI)

Info

  • access - public

Method pseudoClass (line 126)

void pseudoClass( string $name, [string $value = NULL])

Handle a pseudo-class.

Example: :name(value)

Parameters

  • string $name: The pseudo-class name.
  • string $value: The value, if one is found.

Info

  • access - public

Method pseudoElement (line 133)

void pseudoElement( string $name)

Handle a pseudo-element.

Example: ::name

Parameters

  • string $name: The pseudo-element name.

Info

  • access - public

Method sibling (line 153)

void sibling( )

Handle a sibling combinator.

Example: ~

Info

  • access - public

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary


Documentation generated on Sun, 25 Jul 2010 16:09:04 -0500 by phpDocumentor 1.4.3