Commit 92d9f9e7 authored by Amos Latteier's avatar Amos Latteier

Fixed some typos in doc strings and added a missing DOM exception class.

parent 6a6e25b9
...@@ -134,6 +134,8 @@ class HierarchyRequestException(DOMException): ...@@ -134,6 +134,8 @@ class HierarchyRequestException(DOMException):
code = HIERARCHY_REQUEST_ERR code = HIERARCHY_REQUEST_ERR
class WrongDocumentException(DOMException): class WrongDocumentException(DOMException):
code = WRONG_DOCUMENT_ERR code = WRONG_DOCUMENT_ERR
class InvalidCharacterException(DOMException):
code = INVALID_CHARACTER_ERR
class NoDataAllowedException(DOMException): class NoDataAllowedException(DOMException):
code = NO_DATA_ALLOWED_ERR code = NO_DATA_ALLOWED_ERR
class NoModificationAllowedException(DOMException): class NoModificationAllowedException(DOMException):
...@@ -221,12 +223,12 @@ class Node: ...@@ -221,12 +223,12 @@ class Node:
return NodeList() return NodeList()
def getFirstChild(self): def getFirstChild(self):
"""Returns a NodeList that contains all children of this node. """The first child of this node. If there is no such node
If there are no children, this is a empty NodeList""" this returns None."""
return None return None
def getLastChild(self): def getLastChild(self):
"""The last child of this node. If ther is no such node """The last child of this node. If there is no such node
this returns None.""" this returns None."""
return None return None
...@@ -297,15 +299,15 @@ class Element(Node): ...@@ -297,15 +299,15 @@ class Element(Node):
return NodeList(self.objectValues()) return NodeList(self.objectValues())
def getFirstChild(self): def getFirstChild(self):
"""Returns a NodeList that contains all children of this node. """The first child of this node. If there is no such node
If there are no children, this is a empty NodeList""" this returns None"""
children = self.getChildNodes() children = self.getChildNodes()
if children: if children:
return children._data[0] return children._data[0]
return None return None
def getLastChild(self): def getLastChild(self):
"""The last child of this node. If ther is no such node """The last child of this node. If there is no such node
this returns None.""" this returns None."""
children = self.getChildNodes() children = self.getChildNodes()
if children: if children:
...@@ -363,7 +365,7 @@ class Element(Node): ...@@ -363,7 +365,7 @@ class Element(Node):
for child in self.objectValues(): for child in self.objectValues():
if (child.getNodeType()==ELEMENT_NODE and \ if (child.getNodeType()==ELEMENT_NODE and \
child.getTagName()==tagname or tagname== '*'): child.getTagName()==tagname or tagname== '*'):
nodeList.append( child ) nodeList.append(child)
n1 = child.getElementsByTagName(tagname) n1 = child.getElementsByTagName(tagname)
nodeList = nodeList + n1._data nodeList = nodeList + n1._data
return NodeList(nodeList) return NodeList(nodeList)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment