Returns a string or an associative and possibly multidimensional array from a SimpleXMLElement.
210 $nsAttributes = $xmlObject->attributes(self::XML_NAMESPACE);
213 if (
count($xmlObject->attributes()) > 0) {
214 foreach ($xmlObject->attributes() as $key =>
$value) {
215 if ($key ===
'extends') {
221 if (array_key_exists($key,
$config)) {
222 if (!is_array(
$config[$key])) {
234 if (
count($xmlObject->children(self::XML_NAMESPACE)) > 0) {
235 if (
count($xmlObject->children()) > 0) {
236 #require_once 'Zend/Config/Exception.php'; 240 $dom = dom_import_simplexml($xmlObject);
241 $namespaceChildNodes = array();
245 foreach ($dom->childNodes as $node) {
246 if ($node instanceof DOMElement && $node->namespaceURI === self::XML_NAMESPACE) {
247 $namespaceChildNodes[] = $node;
251 foreach ($namespaceChildNodes as $node) {
252 switch ($node->localName) {
254 if (!$node->hasAttributeNS(self::XML_NAMESPACE,
'name')) {
255 #require_once 'Zend/Config/Exception.php'; 259 $constantName = $node->getAttributeNS(self::XML_NAMESPACE,
'name');
261 if (!defined($constantName)) {
262 #require_once 'Zend/Config/Exception.php'; 266 $constantValue = constant($constantName);
268 $dom->replaceChild($dom->ownerDocument->createTextNode($constantValue), $node);
272 #require_once 'Zend/Config/Exception.php'; 277 return (
string) simplexml_import_dom($dom);
281 if (
count($xmlObject->children()) > 0) {
282 foreach ($xmlObject->children() as $key =>
$value) {
296 if (array_key_exists($key,
$config)) {
297 if (!is_array(
$config[$key]) || !array_key_exists(0,
$config[$key])) {
306 }
else if (!isset($xmlObject[
'extends']) && !isset($nsAttributes[
'extends']) && (
count(
$config) === 0)) {
_toArray(SimpleXMLElement $xmlObject)