Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
xml.dom.minidom.NamedNodeMap Class Reference
Inheritance diagram for xml.dom.minidom.NamedNodeMap:
Inheritance graph
[legend]
Collaboration diagram for xml.dom.minidom.NamedNodeMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def item
def items
def itemsNS
def __contains__
def keys
def keysNS
def values
def get
def __eq__
def __ge__
def __gt__
def __le__
def __lt__
def __ne__
def __getitem__
def __setitem__
def getNamedItem
def getNamedItemNS
def removeNamedItem
def removeNamedItemNS
def setNamedItem
def setNamedItemNS
def __delitem__
def __getstate__
def __setstate__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Member Functions

def _get_length
def _cmp

Private Attributes

 _attrs
 _attrsNS
 _ownerElement

Static Private Attributes

tuple __slots__ = ('_attrs', '_attrsNS', '_ownerElement')
 __len__ = _get_length

Detailed Description

The attribute list is a transient interface to the underlying
dictionaries.  Mutations here will change the underlying element's
dictionary.

Ordering is imposed artificially and does not reflect the order of
attributes as found in an input document.

Definition at line 468 of file minidom.py.


Constructor & Destructor Documentation

def xml.dom.minidom.NamedNodeMap.__init__ (   self,
  attrs,
  attrsNS,
  ownerElement 
)

Definition at line 479 of file minidom.py.

00479 
00480     def __init__(self, attrs, attrsNS, ownerElement):
00481         self._attrs = attrs
00482         self._attrsNS = attrsNS
00483         self._ownerElement = ownerElement

Here is the caller graph for this function:


Member Function Documentation

def xml.dom.minidom.NamedNodeMap.__contains__ (   self,
  key 
)

Definition at line 505 of file minidom.py.

00505 
00506     def __contains__(self, key):
00507         if isinstance(key, str):
00508             return key in self._attrs
00509         else:
00510             return key in self._attrsNS

def xml.dom.minidom.NamedNodeMap.__delitem__ (   self,
  attname_or_tuple 
)

Definition at line 623 of file minidom.py.

00623 
00624     def __delitem__(self, attname_or_tuple):
00625         node = self[attname_or_tuple]
00626         _clear_id_cache(node.ownerElement)
00627         node.unlink()

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__eq__ (   self,
  other 
)

Definition at line 531 of file minidom.py.

00531 
00532     def __eq__(self, other):
00533         return self._cmp(other) == 0

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__ge__ (   self,
  other 
)

Definition at line 534 of file minidom.py.

00534 
00535     def __ge__(self, other):
00536         return self._cmp(other) >= 0

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__getitem__ (   self,
  attname_or_tuple 
)

Definition at line 549 of file minidom.py.

00549 
00550     def __getitem__(self, attname_or_tuple):
00551         if isinstance(attname_or_tuple, tuple):
00552             return self._attrsNS[attname_or_tuple]
00553         else:
00554             return self._attrs[attname_or_tuple]

Definition at line 628 of file minidom.py.

00628 
00629     def __getstate__(self):
00630         return self._attrs, self._attrsNS, self._ownerElement

def xml.dom.minidom.NamedNodeMap.__gt__ (   self,
  other 
)

Definition at line 537 of file minidom.py.

00537 
00538     def __gt__(self, other):
00539         return self._cmp(other) > 0

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__le__ (   self,
  other 
)

Definition at line 540 of file minidom.py.

00540 
00541     def __le__(self, other):
00542         return self._cmp(other) <= 0

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__lt__ (   self,
  other 
)

Definition at line 543 of file minidom.py.

00543 
00544     def __lt__(self, other):
00545         return self._cmp(other) < 0

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__ne__ (   self,
  other 
)

Definition at line 546 of file minidom.py.

00546 
00547     def __ne__(self, other):
00548         return self._cmp(other) != 0

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__setitem__ (   self,
  attname,
  value 
)

Definition at line 556 of file minidom.py.

00556 
00557     def __setitem__(self, attname, value):
00558         if isinstance(value, str):
00559             try:
00560                 node = self._attrs[attname]
00561             except KeyError:
00562                 node = Attr(attname)
00563                 node.ownerDocument = self._ownerElement.ownerDocument
00564                 self.setNamedItem(node)
00565             node.value = value
00566         else:
00567             if not isinstance(value, Attr):
00568                 raise TypeError("value must be a string or Attr object")
00569             node = value
00570             self.setNamedItem(node)

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.__setstate__ (   self,
  state 
)

Definition at line 631 of file minidom.py.

00631 
00632     def __setstate__(self, state):
00633         self._attrs, self._attrsNS, self._ownerElement = state
00634 
00635 defproperty(NamedNodeMap, "length",
00636             doc="Number of nodes in the NamedNodeMap.")

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap._cmp (   self,
  other 
) [private]

Definition at line 525 of file minidom.py.

00525 
00526     def _cmp(self, other):
00527         if self._attrs is getattr(other, "_attrs", None):
00528             return 0
00529         else:
00530             return (id(self) > id(other)) - (id(self) < id(other))

Here is the call graph for this function:

Here is the caller graph for this function:

def xml.dom.minidom.NamedNodeMap._get_length (   self) [private]

Definition at line 484 of file minidom.py.

00484 
00485     def _get_length(self):
00486         return len(self._attrs)

def xml.dom.minidom.NamedNodeMap.get (   self,
  name,
  value = None 
)

Definition at line 520 of file minidom.py.

00520 
00521     def get(self, name, value=None):
00522         return self._attrs.get(name, value)

Here is the caller graph for this function:

def xml.dom.minidom.NamedNodeMap.getNamedItem (   self,
  name 
)

Definition at line 571 of file minidom.py.

00571 
00572     def getNamedItem(self, name):
00573         try:
00574             return self._attrs[name]
00575         except KeyError:
00576             return None

Here is the caller graph for this function:

def xml.dom.minidom.NamedNodeMap.getNamedItemNS (   self,
  namespaceURI,
  localName 
)

Definition at line 577 of file minidom.py.

00577 
00578     def getNamedItemNS(self, namespaceURI, localName):
00579         try:
00580             return self._attrsNS[(namespaceURI, localName)]
00581         except KeyError:
00582             return None

Here is the caller graph for this function:

def xml.dom.minidom.NamedNodeMap.item (   self,
  index 
)

Definition at line 487 of file minidom.py.

00487 
00488     def item(self, index):
00489         try:
00490             return self[list(self._attrs.keys())[index]]
00491         except IndexError:
00492             return None

Definition at line 493 of file minidom.py.

00493 
00494     def items(self):
00495         L = []
00496         for node in self._attrs.values():
00497             L.append((node.nodeName, node.value))
00498         return L

Here is the caller graph for this function:

Definition at line 499 of file minidom.py.

00499 
00500     def itemsNS(self):
00501         L = []
00502         for node in self._attrs.values():
00503             L.append(((node.namespaceURI, node.localName), node.value))
00504         return L

Definition at line 511 of file minidom.py.

00511 
00512     def keys(self):
00513         return self._attrs.keys()

Definition at line 514 of file minidom.py.

00514 
00515     def keysNS(self):
00516         return self._attrsNS.keys()

Definition at line 583 of file minidom.py.

00583 
00584     def removeNamedItem(self, name):
00585         n = self.getNamedItem(name)
00586         if n is not None:
00587             _clear_id_cache(self._ownerElement)
00588             del self._attrs[n.nodeName]
00589             del self._attrsNS[(n.namespaceURI, n.localName)]
00590             if 'ownerElement' in n.__dict__:
00591                 n.__dict__['ownerElement'] = None
00592             return n
00593         else:
00594             raise xml.dom.NotFoundErr()

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.removeNamedItemNS (   self,
  namespaceURI,
  localName 
)

Definition at line 595 of file minidom.py.

00595 
00596     def removeNamedItemNS(self, namespaceURI, localName):
00597         n = self.getNamedItemNS(namespaceURI, localName)
00598         if n is not None:
00599             _clear_id_cache(self._ownerElement)
00600             del self._attrsNS[(n.namespaceURI, n.localName)]
00601             del self._attrs[n.nodeName]
00602             if 'ownerElement' in n.__dict__:
00603                 n.__dict__['ownerElement'] = None
00604             return n
00605         else:
00606             raise xml.dom.NotFoundErr()

Here is the call graph for this function:

def xml.dom.minidom.NamedNodeMap.setNamedItem (   self,
  node 
)

Definition at line 607 of file minidom.py.

00607 
00608     def setNamedItem(self, node):
00609         if not isinstance(node, Attr):
00610             raise xml.dom.HierarchyRequestErr(
00611                 "%s cannot be child of %s" % (repr(node), repr(self)))
00612         old = self._attrs.get(node.name)
00613         if old:
00614             old.unlink()
00615         self._attrs[node.name] = node
00616         self._attrsNS[(node.namespaceURI, node.localName)] = node
00617         node.ownerElement = self._ownerElement
00618         _clear_id_cache(node.ownerElement)
00619         return old

Here is the call graph for this function:

Here is the caller graph for this function:

def xml.dom.minidom.NamedNodeMap.setNamedItemNS (   self,
  node 
)

Definition at line 620 of file minidom.py.

00620 
00621     def setNamedItemNS(self, node):
00622         return self.setNamedItem(node)

Here is the call graph for this function:

Definition at line 517 of file minidom.py.

00517 
00518     def values(self):
00519         return self._attrs.values()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 523 of file minidom.py.

Definition at line 477 of file minidom.py.

Definition at line 480 of file minidom.py.

Definition at line 481 of file minidom.py.

Definition at line 482 of file minidom.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: