class XPathExprOr extends XPathExpr
XPathExprOr represents XPath |'d expressions.
Note that unfortunately it isn't the union, it's the sum, so duplicate elements will appear.
This component is a port of the Python lxml library,
which is copyright Infrae and distributed under the BSD license.
Methods
|
__construct(array $items, string $prefix = null)
Constructor. |
||
| string |
getPrefix()
Gets the prefix of this XPath expression. |
from XPathExpr |
| string |
getPath()
Gets the path of this XPath expression. |
from XPathExpr |
| Boolean |
hasStarPrefix()
Answers whether this XPath expression has a star prefix. |
from XPathExpr |
| string |
getElement()
Gets the element of this XPath expression. |
from XPathExpr |
| string |
getCondition()
Gets the condition of this XPath expression. |
from XPathExpr |
| string |
__toString()
Gets a string representation for this XPath expression. |
|
|
addCondition(string $condition)
Adds a condition to this XPath expression. |
from XPathExpr | |
|
addPrefix(string $prefix)
Adds a prefix to this XPath expression. |
from XPathExpr | |
|
addNameTest()
Adds a condition to this XPath expression using the name of the element as the desired value. |
from XPathExpr | |
|
addStarPrefix()
Adds a star prefix to this XPath expression. |
from XPathExpr | |
|
join(string $combiner, XPathExpr $other)
Joins this XPath expression with $other (another XPath expression) using $combiner to join them. |
from XPathExpr | |
| static string |
xpathLiteral(mixed $s)
Gets an XPath literal for $s. |
from XPathExpr |
Details
at line 32
public
__construct(array $items, string $prefix = null)
Constructor.
in XPathExpr at line 53
public string
getPrefix()
Gets the prefix of this XPath expression.
in XPathExpr at line 63
public string
getPath()
Gets the path of this XPath expression.
in XPathExpr at line 73
public Boolean
hasStarPrefix()
Answers whether this XPath expression has a star prefix.
in XPathExpr at line 83
public string
getElement()
Gets the element of this XPath expression.
in XPathExpr at line 93
public string
getCondition()
Gets the condition of this XPath expression.
at line 43
public string
__toString()
Gets a string representation for this XPath expression.
in XPathExpr at line 129
public
addCondition(string $condition)
Adds a condition to this XPath expression.
Any pre-existent condition will be ANDed to it.
in XPathExpr at line 144
public
addPrefix(string $prefix)
Adds a prefix to this XPath expression.
It will be prepended to any pre-existent prefixes.
in XPathExpr at line 158
public
addNameTest()
Adds a condition to this XPath expression using the name of the element as the desired value.
This method resets the element to '*'.
in XPathExpr at line 174
public
addStarPrefix()
Adds a star prefix to this XPath expression.
This method will prepend a '*' to the path and set the star prefix flag
to true.
in XPathExpr at line 197
public
join(string $combiner, XPathExpr $other)
Joins this XPath expression with $other (another XPath expression) using $combiner to join them.
in XPathExpr at line 222
static public string
xpathLiteral(mixed $s)
Gets an XPath literal for $s.