1 | <?php |
||
17 | class Xml |
||
18 | { |
||
19 | /** |
||
20 | * Convert anything DOMDocument|SimpleXMLElement|string to DOMDocument. |
||
21 | * |
||
22 | * @param \DOMDocument|\SimpleXMLElement|string $xml String may be filename or xml string |
||
23 | * |
||
24 | * @throws \InvalidArgumentException |
||
25 | * @return \DOMDocument |
||
26 | */ |
||
27 | public static function toDOMDocument($xml) |
||
58 | |||
59 | /** |
||
60 | * Convert anything DOMDocument|SimpleXMLElement|string to SimpleXMLElement. |
||
61 | * |
||
62 | * @param \DOMDocument|\SimpleXMLElement|string $xml String may be filename or xml string |
||
63 | * |
||
64 | * @throws \InvalidArgumentException |
||
65 | * @return \SimpleXMLElement |
||
66 | */ |
||
67 | public static function toSimpleXMLElement($xml) |
||
90 | |||
91 | /** |
||
92 | * Convert SimpleXMLElement to multidimensional array. |
||
93 | * |
||
94 | * @param \SimpleXMLElement $xml |
||
95 | * @param string $namespace The namespace that schould be used. |
||
96 | * |
||
97 | * @throws \OutOfBoundsException If namespace not found in the xml. |
||
98 | * @return array |
||
99 | */ |
||
100 | public static function toArray(\SimpleXMLElement $xml, $namespace = null) |
||
115 | } |
||
116 |