[thelist] IE DOM and MSHTML wackiness

.jeff jeff at members.evolt.org
Tue Jun 5 14:53:44 CDT 2001


aardvark,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: aardvark
:
: in need of help from those of you familiar
: with IE's DOM...
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<lurch>you rang?</lurch>

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: in converting from the IE DOM to text (and
: vice-versa) through innerHTML and innerText,
: MSHTML converts DOM nodes into text and the
: text into nodes... the problem we are seeing
: is that the IE DOM does not appear to retain
: any additional formatting information... it
: simply parses the DOM out to text, ignoring
: quoted attributes on numeric values, etc...
:
: in short, we enter HTML into a control, and it
: comes out upshifted and with quotes stripped...
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

what's worse -- this is an ie-browser issue and not an issue with the
control or with innerText or innerHTML.  when the browsers parses a page for
rendering it does all of that upshifting and quote removal automatically.  i
don't have the links handy, but this was the subject of debate when ie4 (or
was it 5) originally came out.  a small group of people were really pissed
that ie wasn't storing the source in memory in a compliant format
(regardless of whether the original source was compliant or not).

try this in your browser while viewing the page of your choice:

javascript:alert(document.body.outerHTML); void(0);

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: where is the default DTD or schema that IE
: uses to convert between these two formats?
: can it be overridden? if so how?
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

that's a damn good question.  i wish i knew the answer to it myself.  i've
done plenty of development with ie to give users the ability to format text
without knowing html (sort of a browser-based version of word) and have just
learned to live with the resulting html as i've not found any other way to
fix it -- short of all sorts of nasty server-side regex fun.

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list