Home | History | Annotate | Download | only in dom

Lines Matching defs:Attr

211         # Overridden in Element and Attr where localName can be Non-Null
335 class Attr(Node):
353 # Add the single child node that represents the value of the attr
452 defproperty(Attr, "isId", doc="True if this attribute is an ID.")
453 defproperty(Attr, "localName", doc="Namespace-local name of this attribute.")
454 defproperty(Attr, "schemaType", doc="Schema type for this attribute.")
533 node = Attr(attname)
538 if not isinstance(value, Attr):
539 raise TypeError, "value must be a string or Attr object"
580 if not isinstance(node, Attr):
669 for attr in self._attrs.values():
670 attr.unlink()
688 attr = self.getAttributeNode(attname)
689 if attr is None:
690 attr = Attr(attname)
692 d = attr.__dict__
695 self.setAttributeNode(attr)
696 elif value != attr.value:
697 d = attr.__dict__
699 if attr.isId:
704 attr = self.getAttributeNodeNS(namespaceURI, localname)
705 if attr is None:
707 attr = Attr(qualifiedName, namespaceURI, localname, prefix)
708 d = attr.__dict__
713 self.setAttributeNode(attr)
715 d = attr.__dict__
716 if value != attr.value:
718 if attr.isId:
720 if attr.prefix != prefix:
730 def setAttributeNode(self, attr):
731 if attr.ownerElement not in (None, self):
733 old1 = self._attrs.get(attr.name, None)
736 old2 = self._attrsNS.get((attr.namespaceURI, attr.localName), None)
739 _set_attribute_node(self, attr)
741 if old1 is not attr:
745 if old2 is not attr:
752 attr = self._attrs[name]
755 self.removeAttributeNode(attr)
759 attr = self._attrsNS[(namespaceURI, localName)]
762 self.removeAttributeNode(attr)
859 def _set_attribute_node(element, attr):
861 element._attrs[attr.name] = attr
862 element._attrsNS[(attr.namespaceURI, attr.localName)] = attr
867 attr.__dict__['ownerElement'] = element
1639 a = Attr(qName)
1652 a = Attr(qualifiedName, namespaceURI, localName, prefix)
1698 for attr in node.attributes.values():
1699 if attr.namespaceURI:
1700 if info.isIdNS(attr.namespaceURI, attr.localName):
1701 self._id_cache[attr.value] = node
1702 if attr.value == id:
1706 elif info.isId(attr.name):
1707 self._id_cache[attr.value] = node
1708 if attr.value == id:
1712 elif attr._is_id:
1713 self._id_cache[attr.value] = node
1714 if attr.value == id:
1719 for attr in node.attributes.values():
1720 if attr._is_id:
1721 self._id_cache[attr.value] = node
1722 if attr.value == id:
1827 for attr in node.attributes.values():
1828 clone.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value)
1829 a = clone.getAttributeNodeNS(attr.namespaceURI, attr.localName)
1830 a.specified = attr.specified