[XML-SIG] getDOMImplementation() extension

Martin v. Loewis martin@v.loewis.de
05 Nov 2002 23:41:44 +0100

"Fred L. Drake, Jr." <fdrake@acm.org> writes:

> As I consider in my response to Ray's comments:
> http://lists.w3.org/Archives/Public/www-dom/2002OctDec/0109.html
> the right approach may be to have a second function (either somewhere
> else or with a different name) that does implement the W3C API for
> this, but the overloading of the name may well not be the right way to
> go about this.

Here I strongly disagree: If we have a function getDOMImplementation,
then people *will* expect this to be the W3C function, regardless of
the documentation saying that we have renamed this function.

If people think that it would really be better to return None instead
of raising an exception if no implementation can be found, I'd say
that it is acceptable to break the API here: Few people will be
affected, IMO, and they can readily support multiple versions:

  impl = xml.dom.getDOMImplementation(features)
except ImportError:
  impl = None
if impl is None:
  process error