473,409 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

DOM-2/HTML vs. HTML-4


Taking the BODY element as an example, all of its style attributes
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01,
a fact noted in the DOM Level 2 HTML specification.

The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition section I
read.

Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in the
HTML specification is ipso facto also deprecated in the DOM specification?
[For those doubting the relevance of these questions to this group: Note
that while this question could be put to groups that discuss the HTML
specification, script writers must be aware of both the HTML and DOM
specification, and thus the questions here are relevant to this group.]
Nov 7 '05 #1
9 1980
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
Those are called "presentational" or "format(ting) attributes" to avoid
confusion with the `style' attribute and interface attributes related to
that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,
Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.
Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition section I
read.
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me. Do not confuse the term "attributes" used in
the DOM Specification with the term "attributes" used in the HTML
Specification. The former refers to attributes of the interface; the
latter refers to attributes of the element. However, in the HTML DOM's
case, the DOM API is a representation of attributes of HTML elements
that can be accessed an modified through object properties that are
implementations of attributes of the interface. At least that was the
original idea, taking into account that proprietary DOM implementations
(DOM Level 0) did exactly this before.
Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in
the HTML specification is ipso facto also deprecated in the DOM
specification?


Yes.

"1.1 Introduction

This section extends the DOM Level 2 Core API [DOM Level 2 Core] to
describe objects and methods specific to HTML documents [HTML 4.01],
and XHTML documents [XHTML 1.0] [...]"
PointedEars
Nov 7 '05 #2
Patient Guy wrote:
Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in
the HTML specification is ipso facto also deprecated in the DOM
specification?


Not as such, but it does say:

The transitional or frameset DTD for HTML 4.01, or the XHTML 1.0 DTDs are
assumed. Interoperability between implementations is only guaranteed for
elements and attributes that are specified in the HTML 4.01 and XHTML 1.0
DTDs.

http://www.w3.org/TR/2003/REC-DOM-Le...-ID-1176245063

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Nov 7 '05 #3
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in
news:21****************@PointedEars.de:
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
Those are called "presentational" or "format(ting) attributes" to
avoid confusion with the `style' attribute and interface attributes
related to that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,


Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.


Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition
section I read.


<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me.


As to http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268, how
is that language clear to you? This discusses the DOCUMENT element and
makes a reference to the BODY element as follows:

<quote>
The following properties have been deprecated in favor of the
corresponding ones for the BODY element:

* alinkColor
* background
* bgColor
* fgColor
* linkColor
* vlinkColor
</quote>

That use of language says to me that these element node attributes are
deprecated for the 'document' element and not expressly for the 'body'
element, until we move along to a reading of the 'body' element....

As to the other referenced section, the EXPRESS mention here is that the
HTML 4.01 specification deprecates it. I am looking for a remark in the
DOM-2/HTML specification that states, "any element or attribute or
attribute value deprecated in the HTML 4.01 specification should be
considered to be a deprecated use of these
elements/node/attributes/attribute values in DOM-2/HTML as well." I
suppose there is text to that effect.
Do not confuse the term "attributes" used in
the DOM Specification with the term "attributes" used in the HTML
Specification. The former refers to attributes of the interface; the
latter refers to attributes of the element. However, in the HTML
DOM's case, the DOM API is a representation of attributes of HTML
elements that can be accessed an modified through object properties
that are implementations of attributes of the interface. At least
that was the original idea, taking into account that proprietary DOM
implementations (DOM Level 0) did exactly this before.
Is there text in the DOM specification that states specifically that
the DOM specification yields to or otherwise is fully dependent on
the HTML specification, and that deprecated use of elements and/or
attributes in the HTML specification is ipso facto also deprecated in
the DOM specification?


Yes.

"1.1 Introduction

This section extends the DOM Level 2 Core API [DOM Level 2 Core] to
describe objects and methods specific to HTML documents [HTML 4.01],
and XHTML documents [XHTML 1.0] [...]"


Okay, if by that reading there is an implicit indication or
interpretation that anything forbidden/deprecated in the underlying
specifications is something forbidden/deprecated in the supported
specification, then so be it.
Nov 8 '05 #4
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in
news:21****************@PointedEars.de:
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
Those are called "presentational" or "format(ting) attributes" to
avoid confusion with the `style' attribute and interface attributes
related to that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,


Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.


Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition
section I read.


<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me.


As to http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268, how
is that language clear to you? This discusses the DOCUMENT element and
makes a reference to the BODY element as follows:

<quote>
The following properties have been deprecated in favor of the
corresponding ones for the BODY element:

* alinkColor
* background
* bgColor
* fgColor
* linkColor
* vlinkColor
</quote>

That use of language says to me that these element node attributes are
deprecated for the 'document' element and not expressly for the 'body'
element, until we move along to a reading of the 'body' element....

As to the other referenced section, the EXPRESS mention here is that the
HTML 4.01 specification deprecates it. I am looking for a remark in the
DOM-2/HTML specification that states, "any element or attribute or
attribute value deprecated in the HTML 4.01 specification should be
considered to be a deprecated use of these
elements/node/attributes/attribute values in DOM-2/HTML as well." I
suppose there is text to that effect.
Do not confuse the term "attributes" used in
the DOM Specification with the term "attributes" used in the HTML
Specification. The former refers to attributes of the interface; the
latter refers to attributes of the element. However, in the HTML
DOM's case, the DOM API is a representation of attributes of HTML
elements that can be accessed an modified through object properties
that are implementations of attributes of the interface. At least
that was the original idea, taking into account that proprietary DOM
implementations (DOM Level 0) did exactly this before.
Is there text in the DOM specification that states specifically that
the DOM specification yields to or otherwise is fully dependent on
the HTML specification, and that deprecated use of elements and/or
attributes in the HTML specification is ipso facto also deprecated in
the DOM specification?


Yes.

"1.1 Introduction

This section extends the DOM Level 2 Core API [DOM Level 2 Core] to
describe objects and methods specific to HTML documents [HTML 4.01],
and XHTML documents [XHTML 1.0] [...]"


Okay, if by that reading there is an implicit indication or
interpretation that anything forbidden/deprecated in the underlying
specifications is something forbidden/deprecated in the supported
specification, then so be it.
Nov 8 '05 #5
VK
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01,
a fact noted in the DOM Level 2 HTML specification.

The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition section I
read.

Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in the
HTML specification is ipso facto also deprecated in the DOM specification?
[For those doubting the relevance of these questions to this group: Note
that while this question could be put to groups that discuss the HTML
specification, script writers must be aware of both the HTML and DOM
specification, and thus the questions here are relevant to this group.]
You question arises from the mixture of the HTML which is HiperText
*Markup* Language - and DOM which is Document Object Model. W3C is not
perfectly clear in this domain neither - but they always had problems
to express their thoughts in a common human language.

HTML specification deals *exclusively* with what tags have some
predefined markup associated with them and what attributes in these
tags have additional markup meaning. This way both of markups below has
the same *documented* meaning in HTML 4:

<font color="red">Text</font>
<foo bar="Hello!">Text</foo>

The first one is deprecated, so browser is not obligated to render the
text in red color.
The second one is not defined in the default tags' set so should be
ignored.
Neither of both have any DOM interfaces to be scripted except brute
force innerHTML replacement.
From the other hand DOM specifies which element have, gonna have or

someday maybe will have open interfaces for element manipulations.

This way the answer on your question is: while scripting only DOM
interfaces are important.
For page design you can use (but it doesn't mean that you should) any
tags starting from Netscape 3 set (except <blink> maybe) and do not
worry that they will be ignored by some browser. The chances are that
some browser ever exclude <alink> or <font> from its parsing engine
equal to about 0,001 % or less.

Nov 8 '05 #6
Patient Guy wrote:
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote [...]:
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes Those are called "presentational" or "format(ting) attributes" to
avoid confusion with the `style' attribute and interface attributes
related to that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,


Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.


Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition
section I read.


<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me.


As to http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268, how
is that language clear to you? This discusses the DOCUMENT element


Actually, it discusses the HTMLDocument interface. There is no DOCUMENT
element.
and makes a reference to the BODY element as follows:

<quote>
The following properties have been deprecated in favor of the
corresponding ones for the BODY element:

* alinkColor
* background
* bgColor
* fgColor
* linkColor
* vlinkColor
</quote>
[...]
Yes. And if you access the second URI, you can read

| Interface HTMLBodyElement
|
| The HTML document body. This element is always present in the DOM API,
| even if the tags are not present in the source document. See the BODY
| element definition in HTML 4.01.
As to the other referenced section, the EXPRESS mention here is that the
HTML 4.01 specification deprecates it.
Yes, exactly.
I am looking for a remark in the DOM-2/HTML specification that states,
"any element or attribute or attribute value deprecated in the HTML 4.01
specification should be considered to be a deprecated use of these
elements/node/attributes/attribute values in DOM-2/HTML as well." I
suppose there is text to that effect.


And I quoted it. The W3C DOM Level 2 HTML Specification is explicitly based
on the W3C HTML 4.01 Specification and the W3C XHTML 1.0 Specification.
PointedEars
Nov 8 '05 #7
VK wrote:
Patient Guy wrote:
You question arises from the mixture of the HTML which is HiperText
H_y_perText -- beyond text
*Markup* Language - and DOM which is Document Object Model. W3C is not
perfectly clear in this domain neither - but they always had problems
to express their thoughts in a common human language.
Nonsense. They are almost always pretty clear, but many people often
don't bother to understand.
HTML specification deals *exclusively* with what tags have some
predefined markup associated with them and what attributes in these
tags have additional markup meaning. This way both of markups below
has the same *documented* meaning in HTML 4:

<font color="red">Text</font>
<foo bar="Hello!">Text</foo>

The first one is deprecated, so browser is not obligated to render the
text in red color.
Nonsense.

,-<http://www.w3.org/TR/html4/conform.html#h-4.1>
|
| Deprecated
| A deprecated element or attribute is one that has been outdated by newer
| constructs. Deprecated elements are defined in the reference manual in
| appropriate locations, but are clearly marked as deprecated. Deprecated
| elements may become obsolete in future versions of HTML.
|
| User agents should continue to support deprecated elements for reasons
| of backward compatibility.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
| Definitions of elements and attributes clearly indicate which are
| deprecated.
|
| This specification includes examples that illustrate how to avoid using
| deprecated elements. In most cases these depend on user agent support
| for style sheets. In general, authors should use style sheets to achieve
| stylistic and formatting effects rather than HTML presentational
| attributes. HTML presentational attributes have been deprecated when
| style sheet alternatives exist (see, for example, [CSS1]).
The second one is not defined in the default tags' set so should be
ignored.
No.

,-<http://www.w3.org/TR/html4/appendix/notes.html#h-B.1
|
| The following notes are informative, not normative. Despite the
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
| appearance of words such as "must" and "should", all requirements
| in this section appear elsewhere in the specification.
|
| B.1 Notes on invalid documents
|
| However, to facilitate experimentation and interoperability between
| implementations of various versions of HTML, we recommend the following
| behavior:
|
| [...]
| - If a user agent encounters an element it does not recognize, it should
| try to render the element's content.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
| - If a user agent encounters an attribute it does not recognize, it should
| ignore the entire attribute specification (i.e., the attribute and its
| value).
| [...]
| Since user agents may vary in how they handle error conditions, authors
| and users must not rely on specific error recovery behavior.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
Neither of both have any DOM interfaces to be scripted except brute
force innerHTML replacement.


Nonsense. The HTMLFontElement interface is defined in W3C DOM Level 2
HTML, and even if using the latter `foo' element would not result in HTML,
DOM interfaces can be used to access it, just not W3C DOM Level 2 HTML
interfaces but those of W3C DOM Level 2+ Core.

<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-43943847>
<http://www.w3.org/TR/DOM-Level-2-Core/>
<http://www.w3.org/TR/DOM-Level-3-Core/>
PointedEars
Nov 8 '05 #8
Thomas 'PointedEars' Lahn wrote:
VK wrote:
Neither of both have any DOM interfaces to be scripted except brute
force innerHTML replacement.


Nonsense. The HTMLFontElement interface is defined in W3C DOM Level 2
HTML, and even if using the latter `foo' element would not result in HTML,
DOM interfaces can be used to access it, just not W3C DOM Level 2 HTML
interfaces but those of W3C DOM Level 2+ Core.

<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-43943847>
<http://www.w3.org/TR/DOM-Level-2-Core/>
<http://www.w3.org/TR/DOM-Level-3-Core/>


and, of course, any proprietary DOM the UA may provide.
The term "DOM" is _not_ restricted to the W3C DOM.
PointedEars, JFTR
Nov 8 '05 #9
VK
<FLUD>
VK wrote:
You question arises from the mixture of the HTML which is HiperText
Thomas 'PointedEars' Lahn wrote:
H_y_perText -- beyond text


OK. you've got me on this one, indeed a stupid typo. Go get some beer
to celebrate, it's your day.
;-)

</FLUD>

Nov 8 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Skip Montanaro | last post by:
I'm getting somewhat painfully acquainted with xml.dom.minidom. What is the relationship between its documentElement attribute and its childNodes list? I thought XML documents consisted of a...
1
by: Juliano Freitas | last post by:
Hello! i'm usin a DOM module to process a xml file. I'm having problems with the appenChild function. Why in my example below i can't append the child 'ele' into the swdb. <swdb>...
0
by: Dale Gerdemann | last post by:
I've been trying to use DOM level 3 with xerces-2_6_2. There's a sample called samples/DOM3.java, but I've had trouble with compilation. I've downloaded Xerces-J-bin.2.6.2 and...
7
by: Ganesh Gella | last post by:
Hi All, I am planning to use Xalan to transform XML data by applying xls stylesheets. Here tricky part is, Xalan provides several C++ APIs, which are very much useful if our requirement is...
5
by: Chris | last post by:
Hi, the docs say : "The Xml-document is not loaded into memory when using XmlTextReader, as opposed to using the DOM where the entire document is loaded in memory" but, when using...
5
by: segfalt | last post by:
Hey All, I'm wondering if someone can give me a hand with the following. I'm frequently updating xml files, sometimes in bulk updates. I'm having trouble getting the output formatted nicely...
4
by: YAD | last post by:
How do you decide which DOM level you should use? I've been told level 2 is the "modern" approach, but also saw a website that said use level 0 any time you can. Should you use higher-level code...
1
by: pbd22 | last post by:
hi. for some reason i am not able to navigate the dom. i keep getting the 'no properties' error but i think i am doing everything right. this is an XML response from an AJAX call. The ajax...
0
by: Greg Copeland | last post by:
I am attempting to freeze an application which uses the dom.minidom parser. When I execute my application, I get an import error of: ImportError: No module named dom.minidom. During the freeze...
9
by: Lie | last post by:
Why this generates AttributeError, then not? Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.