1 | <?php |
||
9 | class QuiteSimpleXMLElement extends SimpleXMLElementWrapper |
||
10 | { |
||
11 | /** |
||
12 | * @var SimpleXMLElement |
||
13 | */ |
||
14 | public $el; |
||
15 | |||
16 | /** |
||
17 | * Get a node attribute value. |
||
18 | * |
||
19 | * @param string $attribute |
||
20 | * @return string |
||
21 | */ |
||
22 | public function attr($attribute) |
||
26 | |||
27 | /** |
||
28 | * Get the first node matching an XPath query, or null if no match. |
||
29 | * |
||
30 | * @param string $path |
||
31 | * @return QuiteSimpleXMLElement |
||
32 | */ |
||
33 | public function first($path) |
||
40 | |||
41 | /** |
||
42 | * Check if the document has at least one node matching an XPath query. |
||
43 | * |
||
44 | * @param string $path |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function has($path) |
||
53 | |||
54 | /** |
||
55 | * Get all nodes matching an XPath query. |
||
56 | * |
||
57 | * @param string $path |
||
58 | * @return QuiteSimpleXMLElement[] |
||
59 | */ |
||
60 | public function xpath($path) |
||
66 | |||
67 | /** |
||
68 | * Alias for `xpath()`. |
||
69 | * |
||
70 | * @param $path |
||
71 | * @return QuiteSimpleXMLElement[] |
||
72 | */ |
||
73 | public function all($path) |
||
77 | |||
78 | /** |
||
79 | * Get the text of the first node matching an XPath query. By default, |
||
80 | * the text will be trimmed, but if you want the untrimmed text, set |
||
81 | * the second paramter to False. |
||
82 | * |
||
83 | * @param string $path |
||
84 | * @param bool $trim |
||
85 | * @return string |
||
86 | */ |
||
87 | public function text($path='.', $trim=true) |
||
93 | } |
||
94 |