W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: createTextNode vs INVALID_CHARACTER_ERR

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Fri, 27 Jul 2001 08:44:40 -0400
To: "Julian F. Reschke" <julian.reschke@greenbytes.de>
Cc: <www-dom@w3.org>
Message-ID: <OFC176210E.CBE36FDD-ON85256A96.0045693C@pok.ibm.com>

>I just discovered that DOM L2's createTextNode doesn't declare a
>DOMException.

That's deliberate. Checking every character of every text operation would
be a significant computational expense, and in many cases entirely
unnecessary since the application software may already have ensured that
the data is valid. Hence -- as with some of the other operations -- the DOM
does _not_ continuously enforce well-formedness of text node contents.

DOM Level 3 is planning to define operations that perform more intensive
well-formedness checks, and _may_ include a mode in which validity and
well-formedness are checked continuously. This is still under design, and
may be an optional Feature not present in all DOMs.

Until that design is finished, approved, and implemented, figure on
checking your own character data where and when that's necessary -- before
passing it into the DOM, or at serialization time.
______________________________________
Joe Kesselman  / IBM Research
Received on Friday, 27 July 2001 08:45:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:49 GMT