DOM Level 2 comments

I just spent some time reviewing the DOM Level 2 proposal.  Overall it
looks good, but I am very disheartened to see that once again what I
consider to be an extremely useful feature seems to have been left
out.

In particular, it looks like there is still no way to build a document
fragment, element or range from unparsed text.  In building web
applications, I've found Microsoft's capability in this respect to be
extremely useful (that is, the innerHTML and outerHTML properties and
related properties and methods).  They're particularly useful in
applications where pages are dynamically generated from database
information, which may include in some cases HTML fragments stored in
the database.

I'm not suggesting taking Microsoft's model as-is necessarily, but it
is a serious handicap to building highly-interactive,
dynamically-generated pages to not have something equivalent.  I can
think of a number of places this kind of functionality could be added.
For example, methods that create DocumentFragment or Element could
have variants that accept an unparsed text string as an argument.  Or
Element could be give .open, .write, and .close methods.  Or Range
objects could have a methods that replaces the contents of a range
with a range built from parsing text that is passed in.  Etc.  You
have functionality like this for style sheets (e.g.
StyleSheet.insertRule and its "inverse", CSSRule.cssText).  Why not
have them for all document contents?

A way to get the text representation of the current state of a
fragment, element or range would also be extremely useful.

--Gregg Yost
  Chief Architect
  Ellora Software, Inc.

Received on Tuesday, 27 July 1999 03:41:18 UTC