W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2002

RE: Worth adding "avoid createElement()/createAttribute()"?

From: Sander Bos <sander@x-hive.com>
Date: Fri, 18 Oct 2002 10:12:16 +0200
Message-ID: <41D11F414A26E942912B7E7696DC8E22061624@JAKARTA.xhive.archipel>
To: "WWW DOM" <www-dom@w3.org>

> I am still seeing people confused by the fact that 
> createElement("foo") 
> and createElementNS(null,"foo") are not interchangable. Ditto for 
> attributes.

This must mean that some people do not read the DOM specification in its
entirety when they start using the DOM.

> I can point them to DOM 2.0 Core 1.1.8, but it would be good 
> to have an 
> official practical-advice summary. "Yes, they're different 
> and not really 
> ineroperable. Unless you are writing a pure DOM 1.0 
> application, don't use 
> the non-namespace-aware version of these calls." 
> Might be worth considering for future releases.)

I second the motion.

If they can't simply be deprecated, I would still use deprecation style
(so forcefull) language, example:
	public Element createElement(java.lang.String tagName) throws
	  <p>You should not use this method, use createElementNS(null,
tagName) instead.
	  See <a href="*">the DOM specification</a> for details.</p>
	  Creates an element of the type ....
the same for createAttribute, setAttribute (there are a bunch of others,
but most are getters so there it is not that important?).

Kind regards,


Received on Friday, 18 October 2002 04:12:54 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:10 UTC