From 6f92cc240dcf9213fe7e71e3409785d1d4751ad5 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 5 Oct 2009 18:35:16 +0200 Subject: [PATCH] We have to use the full tag name (including namespace) when calling createElementNS() or setAttributeNS(). --- framework/Xml_Element/lib/Horde/Xml/Element.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/Xml_Element/lib/Horde/Xml/Element.php b/framework/Xml_Element/lib/Horde/Xml/Element.php index bafabadcc..a67d3b696 100644 --- a/framework/Xml_Element/lib/Horde/Xml/Element.php +++ b/framework/Xml_Element/lib/Horde/Xml/Element.php @@ -177,8 +177,8 @@ class Horde_Xml_Element implements ArrayAccess $firstKey = key($value); if ($firstKey === 0) { if (strpos($element, ':') !== false) { - list($ns, $elt) = explode(':', $element, 2); - $baseNode = $this->_element->ownerDocument->createElementNS(Horde_Xml_Element::lookupNamespace($ns), $elt); + list($ns) = explode(':', $element, 2); + $baseNode = $this->_element->ownerDocument->createElementNS(Horde_Xml_Element::lookupNamespace($ns), $element); } else { $baseNode = $this->_element->ownerDocument->createElement($element); } @@ -359,7 +359,7 @@ class Horde_Xml_Element implements ArrayAccess $nodes = $this->_children($var); if (!$nodes) { if (strpos($var, ':') !== false) { - list($ns, $elt) = explode(':', $var, 2); + list($ns) = explode(':', $var, 2); $node = $this->_element->ownerDocument->createElementNS(Horde_Xml_Element::lookupNamespace($ns), $var, $val); $this->_element->appendChild($node); } else { @@ -576,8 +576,8 @@ class Horde_Xml_Element implements ArrayAccess $this->_ensureAppended(); if (strpos($offset, ':') !== false) { - list($ns, $attr) = explode(':', $offset, 2); - $result = $this->_element->setAttributeNS(Horde_Xml_Element::lookupNamespace($ns), $attr, $value); + list($ns) = explode(':', $offset, 2); + $result = $this->_element->setAttributeNS(Horde_Xml_Element::lookupNamespace($ns), $offset, $value); } else { $result = $this->_element->setAttribute($offset, $value); } -- 2.11.0