Definition at line 44 of file grima-xmlbag.php.
◆ __construct()
| XMLAsArrayOfWhateversSpecifiedByXPath::__construct |
( |
|
$xml, |
|
|
|
$context_node |
|
) |
| |
Definition at line 48 of file grima-xmlbag.php.
References $context_node, and $xml.
49 if( is_string(
$xml ) ) {
50 $this->xml =
new DOMDocument();
51 $this->xml->loadXML(
$xml );
52 } elseif(
$xml instanceof DOMDocument ) {
55 throw new Exception(
"<xml> must be of type DOMDocument in new XMLAsArrayOf...(xml,context)");
57 $this->xpath =
new DOMXPath($this->xml);
61 if( $nodeList->length === 1 ) {
62 $this->context_node = $nodeList->item(0);
64 $this->context_node = $this->xml->documentElement;
69 $this->context_node = $this->xml->documentElement;
◆ __get()
| XMLAsArrayOfWhateversSpecifiedByXPath::__get |
( |
string |
$name | ) |
|
Definition at line 82 of file grima-xmlbag.php.
References query().
83 $class = get_class($this);
84 return new $class( $this->xml, $this->
query($name) );
◆ __isset()
| XMLAsArrayOfWhateversSpecifiedByXPath::__isset |
( |
string |
$name | ) |
|
◆ __set()
| XMLAsArrayOfWhateversSpecifiedByXPath::__set |
( |
string |
$name, |
|
|
|
$value |
|
) |
| |
◆ __toString()
| XMLAsArrayOfWhateversSpecifiedByXPath::__toString |
( |
| ) |
|
Definition at line 79 of file grima-xmlbag.php.
80 return $this->xml->saveXML( $this->context_node );
◆ __unset()
| XMLAsArrayOfWhateversSpecifiedByXPath::__unset |
( |
string |
$name | ) |
|
◆ query()
| XMLAsArrayOfWhateversSpecifiedByXPath::query |
( |
string |
$offset | ) |
|
|
protected |
Definition at line 72 of file grima-xmlbag.php.
Referenced by __get(), XMLAsArrayOfDOMNodesSpecifiedByXPath\offsetExists(), XMLAsArrayOfDOMNodeListsSpecifiedByXPath\offsetExists(), XMLAsArrayOfStringsSpecifiedByXPath\offsetExists(), XMLAsArrayOfDOMNodesSpecifiedByXPath\offsetGet(), XMLAsArrayOfDOMNodeListsSpecifiedByXPath\offsetGet(), XMLAsArrayOfStringsSpecifiedByXPath\offsetGet(), XMLAsArrayOfDOMNodesSpecifiedByXPath\offsetSet(), XMLAsArrayOfDOMNodeListsSpecifiedByXPath\offsetSet(), XMLAsArrayOfStringsSpecifiedByXPath\offsetSet(), XMLAsArrayOfDOMNodesSpecifiedByXPath\offsetUnset(), and XMLAsArrayOfDOMNodeListsSpecifiedByXPath\offsetUnset().
73 if( isset( $this->context_node ) ) {
74 return $this->xpath->query( $offset, $this->context_node );
76 return $this->xpath->query( $offset );
◆ $context_node
| XMLAsArrayOfWhateversSpecifiedByXPath::$context_node |
◆ $xml
| XMLAsArrayOfWhateversSpecifiedByXPath::$xml |
◆ $xpath
| XMLAsArrayOfWhateversSpecifiedByXPath::$xpath = null |
|
private |
The documentation for this class was generated from the following file: