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

> 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