diff emeraldtree/ElementTree.py @ 4:705fc192cd9d

Add new Node class and make it a base of Element. * emeraldtree/ElementTree.py - Add Node. - Make Node a base of Element. - Export Node. * emeraldtree/tests/test_ElementTree.py: Update.
author Bastian Blank <bblank@thinkmo.de>
date Sat, 31 May 2008 15:19:09 +0200
parents 34be1290ac0b
children 9b72cb3ef3c9
line wrap: on
line diff
--- a/emeraldtree/ElementTree.py	Sat May 31 15:10:47 2008 +0200
+++ b/emeraldtree/ElementTree.py	Sat May 31 15:19:09 2008 +0200
@@ -87,6 +87,7 @@
     "Element", "ElementTree",
     "fromstring", "fromstringlist",
     "iselement", "iterparse",
+    "Node",
     "parse", "ParseError",
     "PI", "ProcessingInstruction",
     "QName",
@@ -168,6 +169,11 @@
     # for tag/attrib/text attributes
     return isinstance(element, Element) or hasattr(element, "tag")
 
+class Node(object):
+    """
+    Node class.
+    """
+
 ##
 # Element class.  This class defines the Element interface, and
 # provides a reference implementation of this interface.
@@ -183,7 +189,7 @@
 # @see Comment
 # @see ProcessingInstruction
 
-class Element(object):
+class Element(Node):
     # <tag attrib>text<child/>...</tag>tail
 
     ##