public function getOrCreateAttributeNode($qname)
    {
        if ($attr = $this->getAttributeNode($qname)) return $attr;

        $attr = new PHPTAL_Dom_Attr($qname, "", null, 'UTF-8'); // FIXME: should find namespace and encoding
        $this->attribute_nodes[] = $attr;
        return $attr;
    }
public function getOrCreateAttributeNode($qname)
    {
        if ($attr = $this->getAttributeNode($qname)) return $attr;

        $attr = new PHPTAL_Dom_Attr($qname, "", null, 'UTF-8'); // FIXME: should find namespace and encoding
        $this->attribute_nodes[] = $attr;
        return $attr;
    }
public function getOrCreateAttributeNode ( $ qname ) { if ( $ attr = $ this -> getAttributeNode ( $ qname ) ) return $ attr ; $ attr = new PHPTAL_Dom_Attr ( $ qname , "" , null , 'UTF-8' ) ; // FIXME: should find namespace and encoding $ this -> attribute_nodes [ ] = $ attr ; return $ attr ; }
If possible, use getAttributeNodeNS and setAttributeNS.

NB: This method doesn't handle namespaces properly.
If possible use getAttributeNodeNS and setAttributeNS .