Example #1
0
 def items(self):
     L = []
     for i in range(0, len(self)):
         I = _cODP.ODPNamedNodeMap_item(self.this, i)
         L.append(
             (_cODP.ODPNode_getNodeName(I), _cODP.ODPNode_getNodeValue(I)))
     return L
Example #2
0
 def __getitem__(self, i):
     if type(i) == IntType:
         if (i > 0) and (i < len(self)):
             return self.item(i)
         else:
             raise IndexError
     return _cODP.ODPNode_getNodeValue(
         _cODP.ODPNamedNodeMap_getNamedItem(self.this, name))
Example #3
0
 def get(self, name, value=None):
     I = _cODP.ODPNamedNodeMap_getNamedItem(self.this, name)
     if I is None:
         return value
     return _cODP.ODPNode_getNodeValue(I)