@@ -227,17 +227,20 @@ def _get_localName(self):
227227 # Overridden in Element and Attr where localName can be Non-Null
228228 return None
229229
230- # Node interfaces from Level 3 (WD 9 April 2002)
230+ # Node interfaces from DOM Level 3
231231
232232 def isSameNode (self , other ):
233233 return self is other
234234
235- def getInterface (self , feature ):
236- if self .isSupported (feature , None ):
235+ def getFeature (self , feature , version ):
236+ if self .isSupported (feature , version ):
237237 return self
238238 else :
239239 return None
240240
241+ def getInterface (self , feature ):
242+ return self .getFeature (feature , None )
243+
241244 # The "user data" functions use a dictionary that is only present
242245 # if some user data has been set, so be careful not to assume it
243246 # exists.
@@ -504,9 +507,12 @@ def _get_schemaType(self):
504507 else :
505508 return info .getAttributeType (self .nodeName )
506509
510+ _get_schemaTypeInfo = _get_schemaType
511+
507512defproperty (Attr , "isId" , doc = "True if this attribute is an ID." )
508513defproperty (Attr , "localName" , doc = "Namespace-local name of this attribute." )
509514defproperty (Attr , "schemaType" , doc = "Schema type for this attribute." )
515+ defproperty (Attr , "schemaTypeInfo" , doc = "Schema type for this attribute." )
510516
511517
512518class NamedNodeMap (object ):
@@ -712,7 +718,7 @@ class Element(Node):
712718 'nextSibling' , 'previousSibling' )
713719 nodeType = Node .ELEMENT_NODE
714720 nodeValue = None
715- schemaType = _no_type
721+ schemaType = schemaTypeInfo = _no_type
716722
717723 _magic_id_nodes = 0
718724
@@ -1220,9 +1226,14 @@ def _get_isWhitespaceInElementContent(self):
12201226 else :
12211227 return info .isElementContent ()
12221228
1229+ _get_isElementContentWhitespace = _get_isWhitespaceInElementContent
1230+
12231231defproperty (Text , "isWhitespaceInElementContent" ,
12241232 doc = "True iff this text node contains only whitespace"
12251233 " and is in element content." )
1234+ defproperty (Text , "isElementContentWhitespace" ,
1235+ doc = "True iff this text node contains only whitespace"
1236+ " and is in element content." )
12261237defproperty (Text , "wholeText" ,
12271238 doc = "The text of all logically-adjacent text nodes." )
12281239
@@ -1429,12 +1440,36 @@ def __init__(self, name, publicId, systemId, notation):
14291440 def _get_actualEncoding (self ):
14301441 return self .actualEncoding
14311442
1443+ def _get_inputEncoding (self ):
1444+ return self .actualEncoding
1445+
1446+ def _set_inputEncoding (self , value ):
1447+ self .actualEncoding = value
1448+
1449+ inputEncoding = property (_get_inputEncoding , _set_inputEncoding )
1450+
14321451 def _get_encoding (self ):
14331452 return self .encoding
14341453
1454+ def _get_xmlEncoding (self ):
1455+ return self .encoding
1456+
1457+ def _set_xmlEncoding (self , value ):
1458+ self .encoding = value
1459+
1460+ xmlEncoding = property (_get_xmlEncoding , _set_xmlEncoding )
1461+
14351462 def _get_version (self ):
14361463 return self .version
14371464
1465+ def _get_xmlVersion (self ):
1466+ return self .version
1467+
1468+ def _set_xmlVersion (self , value ):
1469+ self .version = value
1470+
1471+ xmlVersion = property (_get_xmlVersion , _set_xmlVersion )
1472+
14381473 def appendChild (self , newChild ):
14391474 raise xml .dom .HierarchyRequestErr (
14401475 "cannot append children to an entity node" )
@@ -1567,14 +1602,17 @@ def createDocumentType(self, qualifiedName, publicId, systemId):
15671602 doctype .systemId = systemId
15681603 return doctype
15691604
1570- # DOM Level 3 (WD 9 April 2002)
1605+ # DOM Level 3
15711606
1572- def getInterface (self , feature ):
1573- if self .hasFeature (feature , None ):
1607+ def getFeature (self , feature , version ):
1608+ if self .hasFeature (feature , version ):
15741609 return self
15751610 else :
15761611 return None
15771612
1613+ def getInterface (self , feature ):
1614+ return self .getFeature (feature , None )
1615+
15781616 # internal
15791617 def _create_document (self ):
15801618 return Document ()
@@ -1644,7 +1682,7 @@ class Document(Node, DocumentLS):
16441682 previousSibling = nextSibling = None
16451683
16461684
1647- # Document attributes from Level 3 (WD 9 April 2002)
1685+ # Document attributes from DOM Level 3
16481686
16491687 actualEncoding = None
16501688 encoding = None
@@ -1675,6 +1713,14 @@ def _get_elem_info(self, element):
16751713 def _get_actualEncoding (self ):
16761714 return self .actualEncoding
16771715
1716+ def _get_inputEncoding (self ):
1717+ return self .actualEncoding
1718+
1719+ def _set_inputEncoding (self , value ):
1720+ self .actualEncoding = value
1721+
1722+ inputEncoding = property (_get_inputEncoding , _set_inputEncoding )
1723+
16781724 def _get_doctype (self ):
16791725 return self .doctype
16801726
@@ -1684,18 +1730,42 @@ def _get_documentURI(self):
16841730 def _get_encoding (self ):
16851731 return self .encoding
16861732
1733+ def _get_xmlEncoding (self ):
1734+ return self .encoding
1735+
1736+ def _set_xmlEncoding (self , value ):
1737+ self .encoding = value
1738+
1739+ xmlEncoding = property (_get_xmlEncoding , _set_xmlEncoding )
1740+
16871741 def _get_errorHandler (self ):
16881742 return self .errorHandler
16891743
16901744 def _get_standalone (self ):
16911745 return self .standalone
16921746
1747+ def _get_xmlStandalone (self ):
1748+ return self .standalone
1749+
1750+ def _set_xmlStandalone (self , value ):
1751+ self .standalone = value
1752+
1753+ xmlStandalone = property (_get_xmlStandalone , _set_xmlStandalone )
1754+
16931755 def _get_strictErrorChecking (self ):
16941756 return self .strictErrorChecking
16951757
16961758 def _get_version (self ):
16971759 return self .version
16981760
1761+ def _get_xmlVersion (self ):
1762+ return self .version
1763+
1764+ def _set_xmlVersion (self , value ):
1765+ self .version = value
1766+
1767+ xmlVersion = property (_get_xmlVersion , _set_xmlVersion )
1768+
16991769 def _check_new_child (self , newChild , oldChild = None ):
17001770 Node ._check_new_child (self , newChild , oldChild )
17011771 # A document can have only one element and only one document type.
0 commit comments