Overview

Namespaces

  • None
  • WPGMZA
    • Integration
    • Selector

Classes

  • AttributeSelector
  • Parser
  • PseudoSelector
  • Selector
  • Token
  • Tokenizer
  • TokenStream
  • XPathConverter

Exceptions

  • ConvertException
  • ParseException

Functions

  • trace
  • Overview
  • Namespace
  • Class

Class XPathConverter

Used to convert CSS selectors to XPath queries

Namespace: WPGMZA\Selector
Located at class.selector-to-xpath.php
Methods summary
public
# __construct( )

Constructor.

Constructor.

protected
# convertAttribute( WPGMZA\Selector\AttributeSelector $attr )

Converts a CSS attribute selector to its XPath equivalent and pushes the XPath query string to memory

Converts a CSS attribute selector to its XPath equivalent and pushes the XPath query string to memory

Parameters

$attr
The CSS attribute selector

Throws

WPGMZA\Selector\ConvertException
Unrecognised attribute operator
protected
# convertPseudo( WPGMZA\Selector\AttributeSelector $pseudo )

Converts a CSS pseudo selector to its XPath equivalent and pushes the XPath query string to memory

Converts a CSS pseudo selector to its XPath equivalent and pushes the XPath query string to memory

Parameters

$pseudo
The CSS pseudo selector

Throws

WPGMZA\Selector\ConvertException
Don't know how to convert selector (may not be implemented)
protected
# convertSelector( WPGMZA\Selector\Selector $selector )

Converts a CSS selector to its XPath equivalent and pushes the XPath query string to memory

Converts a CSS selector to its XPath equivalent and pushes the XPath query string to memory

Parameters

$selector
The CSS selector to convert.
protected
# convertElement( WPGMZA\Selector\Selector $element )

Converts an element (eg a single, non-compound CSS selector) to it's XPath equivalent

Converts an element (eg a single, non-compound CSS selector) to it's XPath equivalent

Parameters

$element
The selector to convert

Throws

WPGMZA\Selector\ConvertException
Unexpected element
public string
# convert( string $str )

Converts the given CSS selector string into it's XPath equivalent

Converts the given CSS selector string into it's XPath equivalent

Parameters

$str
The input CSS selector to convert

Returns

string
The XPath equivalent of the supplied selector
Properties summary
protected $parser
#
protected $xpath
#
API documentation generated by ApiGen