This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: xml.dom.minidom incorrectly claims DOM Level 3 conformance
Type: behavior Stage:
Components: XML Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, georg.brandl, karlcow, phihag
Priority: normal Keywords: patch

Created on 2009-05-24 20:42 by phihag, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
minidom-dont-declare-level3.diff phihag, 2009-05-24 20:42 Patch removing the declarations review
Messages (5)
msg88282 - (view) Author: Philipp Hagemeister (phihag) * Date: 2009-05-24 20:42
From DOM Level 3[1]: "An implementation conforms to a DOM Level 3 module
if it supports all the interfaces for that module and the associated
semantics.". minidom supports only some Level 3 functions such as
Node.renameNode, Element.setIdAttribute*, Text.replaceWholeText and
Node.isSameNode.

Apart from full DOM Level 2 conformance such as functional namespace
handling, many semantics are available under a different name, such as
DOMImplementation.getFeature (minidom: getInterface),
Text.getWholeText(minidom: _getWholeText) or missing
(Attr.schemaTypeInfo, Document.inputEncoding, Document.xmlEncoding,
Document.xmlStandalone, Document.xmlVersion, Document.domConfig,
Document.adoptNode, Document.normalizeDocument,
DOMException.VALIDATION_ERR, DOMException.TYPE_MISMATCH_ERR,
Node.baseURI, Node.textContent, Node.compareDocumentPosition,
Node.lookupPrefix, Node.isDefaultNamespace, Node.lookupNamespaceURI,
Node.isEqualNode, Node.DOCUMENT_POSITION_*,
Text.isElementContentWhitespace).

Users explicitely asking for DOM Level 3 conformance will run into
unexpected problems. Attached is a patch that removes the DOM L3
conformance declarations.
msg88284 - (view) Author: Philipp Hagemeister (phihag) * Date: 2009-05-24 21:01
Forgot the reference:

[1] http://www.w3.org/TR/DOM-Level-3-Core/introduction.html#ID-Conformance
msg111538 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-25 12:49
Could someone with minidom experience please comment on this, thanks.
msg118714 - (view) Author: karl (karlcow) * Date: 2010-10-14 19:55
The source of 3.1/lib/python3.1/xml/dom/__init__.py is correct 

===========
minidom -- A simple implementation of the Level 1 DOM with namespace
           support added (based on the Level 2 specification) and other
           minor Level 2 functionality.
===========

Even the level 2  implementation is partial. Some of the Level 3 implementation are based on a 9 April 2002 Working Draft. Comments like these ones are into the code.

# Node interfaces from Level 3 (WD 9 April 2002)

To note that there will be a need for a big code change in xml.dom to implement in the future webdomcore. Maybe a xml.dom.webdomcore would be welcome. http://www.w3.org/TR/domcore/

The request is valid.
msg118815 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-15 18:02
Applied in r85547.
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50348
2010-10-15 18:02:39georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg118815

resolution: fixed
2010-10-14 19:55:59karlcowsetnosy: + karlcow
messages: + msg118714
2010-07-25 12:49:05BreamoreBoysetnosy: + BreamoreBoy

messages: + msg111538
versions: + Python 3.1
2009-05-24 21:01:05phihagsetmessages: + msg88284
2009-05-24 20:42:59phihagcreate