getAttributes() public method

public getAttributes ( ) : TMap
return Prado\Collections\TMap list of attributes
示例#1
0
 /**
  * Recursively converts DOM XML nodes into TXmlElement
  * @param DOMXmlNode the node to be converted
  * @return TXmlElement the converted TXmlElement
  */
 protected function buildElement($node)
 {
     $element = new TXmlElement($node->tagName);
     $element->setValue($node->nodeValue);
     foreach ($node->attributes as $name => $attr) {
         $element->getAttributes()->add(($attr->prefix === '' ? '' : $attr->prefix . ':') . $name, $attr->value);
     }
     foreach ($node->childNodes as $child) {
         if ($child instanceof \DOMElement) {
             $element->getElements()->add($this->buildElement($child));
         }
     }
     return $element;
 }