Back to index

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

List of all members.

Public Member Functions

def __init__
def appendChild
def insertBefore
def removeChild
def replaceChild
def __bool__
def toxml
def toprettyxml
def hasChildNodes
def normalize
def cloneNode
def isSupported
def isSameNode
def getInterface
def getUserData
def setUserData
def unlink
def __enter__
def __exit__

Public Attributes

 nodeName
 notationName
 childNodes
 publicId
 systemId

Static Public Attributes

 attributes = None
 nodeType = Node.ENTITY_NODE
 nodeValue = None
 actualEncoding = None
 encoding = None
 version = None
 namespaceURI = None
 parentNode = None
 ownerDocument = None
 nextSibling = None
 previousSibling = None
 prefix = EMPTY_PREFIX
int ELEMENT_NODE = 1
int ATTRIBUTE_NODE = 2
int TEXT_NODE = 3
int CDATA_SECTION_NODE = 4
int ENTITY_REFERENCE_NODE = 5
int ENTITY_NODE = 6
int PROCESSING_INSTRUCTION_NODE = 7
int COMMENT_NODE = 8
int DOCUMENT_NODE = 9
int DOCUMENT_TYPE_NODE = 10
int DOCUMENT_FRAGMENT_NODE = 11
int NOTATION_NODE = 12

Private Member Functions

def _get_actualEncoding
def _get_encoding
def _get_version

Detailed Description

Definition at line 1322 of file minidom.py.


Constructor & Destructor Documentation

def xml.dom.minidom.Entity.__init__ (   self,
  name,
  publicId,
  systemId,
  notation 
)

Definition at line 1331 of file minidom.py.

01331 
01332     def __init__(self, name, publicId, systemId, notation):
01333         self.nodeName = name
01334         self.notationName = notation
01335         self.childNodes = NodeList()
01336         self._identified_mixin_init(publicId, systemId)

Here is the caller graph for this function:


Member Function Documentation

def xml.dom.minidom.Node.__bool__ (   self) [inherited]

Definition at line 43 of file minidom.py.

00043 
00044     def __bool__(self):
00045         return True

def xml.dom.minidom.Node.__enter__ (   self) [inherited]

Definition at line 273 of file minidom.py.

00273 
00274     def __enter__(self):
00275         return self

def xml.dom.minidom.Node.__exit__ (   self,
  et,
  ev,
  tb 
) [inherited]

Definition at line 276 of file minidom.py.

00276 
00277     def __exit__(self, et, ev, tb):
00278         self.unlink()
00279 
00280 defproperty(Node, "firstChild", doc="First child node, or None.")
00281 defproperty(Node, "lastChild",  doc="Last child node, or None.")
00282 defproperty(Node, "localName",  doc="Namespace-local name of this node.")
00283 

Here is the call graph for this function:

Definition at line 1337 of file minidom.py.

01337 
01338     def _get_actualEncoding(self):
01339         return self.actualEncoding

def xml.dom.minidom.Entity._get_encoding (   self) [private]

Definition at line 1340 of file minidom.py.

01340 
01341     def _get_encoding(self):
01342         return self.encoding

def xml.dom.minidom.Entity._get_version (   self) [private]

Definition at line 1343 of file minidom.py.

01343 
01344     def _get_version(self):
01345         return self.version

def xml.dom.minidom.Entity.appendChild (   self,
  newChild 
)

Reimplemented from xml.dom.minidom.Node.

Definition at line 1346 of file minidom.py.

01346 
01347     def appendChild(self, newChild):
01348         raise xml.dom.HierarchyRequestErr(
01349             "cannot append children to an entity node")

def xml.dom.minidom.Node.cloneNode (   self,
  deep 
) [inherited]

Reimplemented in xml.dom.minidom.Document, and xml.dom.minidom.DocumentType.

Definition at line 205 of file minidom.py.

00205 
00206     def cloneNode(self, deep):
00207         return _clone_node(self, deep, self.ownerDocument or self)

Here is the call graph for this function:

def xml.dom.minidom.Node.getInterface (   self,
  feature 
) [inherited]

Definition at line 220 of file minidom.py.

00220 
00221     def getInterface(self, feature):
00222         if self.isSupported(feature, None):
00223             return self
00224         else:
00225             return None

Here is the call graph for this function:

def xml.dom.minidom.Node.getUserData (   self,
  key 
) [inherited]

Definition at line 230 of file minidom.py.

00230 
00231     def getUserData(self, key):
00232         try:
00233             return self._user_data[key][0]
00234         except (AttributeError, KeyError):
00235             return None

def xml.dom.minidom.Node.hasChildNodes (   self) [inherited]

Definition at line 64 of file minidom.py.

00064 
00065     def hasChildNodes(self):
00066         if self.childNodes:
00067             return True
00068         else:
00069             return False

def xml.dom.minidom.Entity.insertBefore (   self,
  newChild,
  refChild 
)

Reimplemented from xml.dom.minidom.Node.

Definition at line 1350 of file minidom.py.

01350 
01351     def insertBefore(self, newChild, refChild):
01352         raise xml.dom.HierarchyRequestErr(
01353             "cannot insert children below an entity node")

def xml.dom.minidom.Node.isSameNode (   self,
  other 
) [inherited]

Definition at line 217 of file minidom.py.

00217 
00218     def isSameNode(self, other):
00219         return self is other

Here is the caller graph for this function:

def xml.dom.minidom.Node.isSupported (   self,
  feature,
  version 
) [inherited]

Reimplemented in xml.dom.minidom.Document.

Definition at line 208 of file minidom.py.

00208 
00209     def isSupported(self, feature, version):
00210         return self.ownerDocument.implementation.hasFeature(feature, version)

Here is the caller graph for this function:

def xml.dom.minidom.Node.normalize (   self) [inherited]

Definition at line 178 of file minidom.py.

00178 
00179     def normalize(self):
00180         L = []
00181         for child in self.childNodes:
00182             if child.nodeType == Node.TEXT_NODE:
00183                 if not child.data:
00184                     # empty text node; discard
00185                     if L:
00186                         L[-1].nextSibling = child.nextSibling
00187                     if child.nextSibling:
00188                         child.nextSibling.previousSibling = child.previousSibling
00189                     child.unlink()
00190                 elif L and L[-1].nodeType == child.nodeType:
00191                     # collapse text node
00192                     node = L[-1]
00193                     node.data = node.data + child.data
00194                     node.nextSibling = child.nextSibling
00195                     if child.nextSibling:
00196                         child.nextSibling.previousSibling = node
00197                     child.unlink()
00198                 else:
00199                     L.append(child)
00200             else:
00201                 L.append(child)
00202                 if child.nodeType == Node.ELEMENT_NODE:
00203                     child.normalize()
00204         self.childNodes[:] = L

def xml.dom.minidom.Entity.removeChild (   self,
  oldChild 
)

Reimplemented from xml.dom.minidom.Node.

Definition at line 1354 of file minidom.py.

01354 
01355     def removeChild(self, oldChild):
01356         raise xml.dom.HierarchyRequestErr(
01357             "cannot remove children from an entity node")

def xml.dom.minidom.Entity.replaceChild (   self,
  newChild,
  oldChild 
)

Reimplemented from xml.dom.minidom.Node.

Definition at line 1358 of file minidom.py.

01358 
01359     def replaceChild(self, newChild, oldChild):
01360         raise xml.dom.HierarchyRequestErr(
01361             "cannot replace children of an entity node")

def xml.dom.minidom.Node.setUserData (   self,
  key,
  data,
  handler 
) [inherited]

Definition at line 236 of file minidom.py.

00236 
00237     def setUserData(self, key, data, handler):
00238         old = None
00239         try:
00240             d = self._user_data
00241         except AttributeError:
00242             d = {}
00243             self._user_data = d
00244         if key in d:
00245             old = d[key][0]
00246         if data is None:
00247             # ignore handlers passed for None
00248             handler = None
00249             if old is not None:
00250                 del d[key]
00251         else:
00252             d[key] = (data, handler)
00253         return old

def xml.dom.minidom.Node.toprettyxml (   self,
  indent = "\t",
  newl = "\n",
  encoding = None 
) [inherited]

Definition at line 49 of file minidom.py.

00049 
00050     def toprettyxml(self, indent="\t", newl="\n", encoding=None):
00051         # indent = the indentation string to prepend, per level
00052         # newl = the newline string to append
00053         use_encoding = "utf-8" if encoding is None else encoding
00054         writer = codecs.getwriter(use_encoding)(io.BytesIO())
00055         if self.nodeType == Node.DOCUMENT_NODE:
00056             # Can pass encoding only to document, to put it into XML header
00057             self.writexml(writer, "", indent, newl, encoding)
00058         else:
00059             self.writexml(writer, "", indent, newl)
00060         if encoding is None:
00061             return writer.stream.getvalue().decode(use_encoding)
00062         else:
00063             return writer.stream.getvalue()

Here is the call graph for this function:

Here is the caller graph for this function:

def xml.dom.minidom.Node.toxml (   self,
  encoding = None 
) [inherited]

Definition at line 46 of file minidom.py.

00046 
00047     def toxml(self, encoding=None):
00048         return self.toprettyxml("", "", encoding)

Here is the call graph for this function:

def xml.dom.minidom.Node.unlink (   self) [inherited]

Reimplemented in xml.dom.minidom.Document, xml.dom.minidom.Element, and xml.dom.minidom.Attr.

Definition at line 262 of file minidom.py.

00262 
00263     def unlink(self):
00264         self.parentNode = self.ownerDocument = None
00265         if self.childNodes:
00266             for child in self.childNodes:
00267                 child.unlink()
00268             self.childNodes = NodeList()
00269         self.previousSibling = None
00270         self.nextSibling = None

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1327 of file minidom.py.

int xml.dom.Node.ATTRIBUTE_NODE = 2 [static, inherited]

Definition at line 29 of file __init__.py.

Definition at line 1323 of file minidom.py.

int xml.dom.Node.CDATA_SECTION_NODE = 4 [static, inherited]

Definition at line 31 of file __init__.py.

Reimplemented from xml.dom.minidom.Node.

Definition at line 1334 of file minidom.py.

int xml.dom.Node.COMMENT_NODE = 8 [static, inherited]

Definition at line 35 of file __init__.py.

int xml.dom.Node.DOCUMENT_FRAGMENT_NODE = 11 [static, inherited]

Definition at line 38 of file __init__.py.

int xml.dom.Node.DOCUMENT_NODE = 9 [static, inherited]

Definition at line 36 of file __init__.py.

int xml.dom.Node.DOCUMENT_TYPE_NODE = 10 [static, inherited]

Definition at line 37 of file __init__.py.

int xml.dom.Node.ELEMENT_NODE = 1 [static, inherited]

Definition at line 28 of file __init__.py.

Definition at line 1328 of file minidom.py.

int xml.dom.Node.ENTITY_NODE = 6 [static, inherited]

Definition at line 33 of file __init__.py.

int xml.dom.Node.ENTITY_REFERENCE_NODE = 5 [static, inherited]

Definition at line 32 of file __init__.py.

xml.dom.minidom.Node.namespaceURI = None [static, inherited]

Reimplemented in xml.dom.minidom.Element.

Definition at line 35 of file minidom.py.

xml.dom.minidom.Node.nextSibling = None [static, inherited]

Definition at line 38 of file minidom.py.

Definition at line 1332 of file minidom.py.

Reimplemented from xml.dom.minidom.Node.

Definition at line 1324 of file minidom.py.

Definition at line 1325 of file minidom.py.

int xml.dom.Node.NOTATION_NODE = 12 [static, inherited]

Definition at line 39 of file __init__.py.

Definition at line 1333 of file minidom.py.

xml.dom.minidom.Node.ownerDocument = None [static, inherited]

Definition at line 37 of file minidom.py.

xml.dom.minidom.Node.parentNode = None [static, inherited]

Reimplemented in xml.dom.minidom.Document, and xml.dom.minidom.DocumentFragment.

Definition at line 36 of file minidom.py.

Reimplemented in xml.dom.minidom.Element.

Definition at line 41 of file minidom.py.

xml.dom.minidom.Node.previousSibling = None [static, inherited]

Reimplemented in xml.dom.minidom.Document.

Definition at line 39 of file minidom.py.

Definition at line 34 of file __init__.py.

Reimplemented in xml.dom.minidom.DocumentType.

Definition at line 1253 of file minidom.py.

Reimplemented in xml.dom.minidom.DocumentType.

Definition at line 1254 of file minidom.py.

int xml.dom.Node.TEXT_NODE = 3 [static, inherited]

Definition at line 30 of file __init__.py.

Definition at line 1329 of file minidom.py.


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