470,855 Members | 1,163 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

DTDs: W3C v. O'Reilly et al.

This validates:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

This does not:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/TR/xhtml1" xml:lang="en" lang="en">

What I'm wondering is, why doesn't the second validate? Or perhaps put another
way, why do several books, including HTML and XHTML: The Definitive Guide (an
O'Reilly book) say the second is correct?
Jul 23 '05 #1
5 1285
In article <cq**********@news.xmission.com>,
Paul Wake<wa**********@xmission.com> wrote:
This does not:
xmlns="http://www.w3.org/TR/xhtml1"
What I'm wondering is, why doesn't the second validate?
The namespace declaration is wrong.
Or perhaps put another
way, why do several books, including HTML and XHTML: The Definitive Guide (an
O'Reilly book) say the second is correct?


Please report the error to the publisher if that really is the case.

--
Henri Sivonen
hs******@iki.fi
http://iki.fi/hsivonen/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 23 '05 #2
Paul Wake<wa**********@xmission.com> wrote:
<html xmlns="http://www.w3.org/TR/xhtml1" xml:lang="en" lang="en">

What I'm wondering is, why doesn't the second validate? Or perhaps
put another way, why do several books, including HTML and XHTML:
The Definitive Guide (an O'Reilly book) say the second is correct?
Because the DTD you use specifies that the html element shall have an
xmlns attribute with the exact literal value of
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
Technically, that attribute is not required by the DTD, so it is not
invalid (though it is incorrect by the prose of the HTML specification)
to omit the entire xmnls attribute, but if it is included, its value
shall be the exact string given:

<!ATTLIST html
%i18n;
id ID #IMPLIED
xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'


There's not much point in all of this except in the wider XML
perspective, which is just muddy theory to most authors, so I'm not
really surprised at seeing that a "definitive guide" gets it wrong.

(The string http://www.w3.org/1999/xhtml as a namespace name is
somewhat odd, due to the 1999/ part, but there's presumably some higher
truth behind this apparent oddity, at least if you ask them.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #3
In article <Xn****************************@193.229.0.31>,
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote:
Because the DTD you use specifies that the html element shall have an
xmlns attribute with the exact literal value of
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
ITYM "exact literal value of 'http://www.w3.org/1999/xhtml'".
Technically, that attribute is not required by the DTD, so it is not
invalid (though it is incorrect by the prose of the HTML specification)
s/HTML/XHTML/
There's not much point in all of this except in the wider XML
perspective,
Defaulting the namespace in the DTD is an extremely bad idea considering
DTDless parsing.
(The string http://www.w3.org/1999/xhtml as a namespace name is
somewhat odd, due to the 1999/ part, but there's presumably some higher
truth behind this apparent oddity, at least if you ask them.)


It appears they think a URL should show the year it was minted. Not very
useful here.

--
Henri Sivonen
hs******@iki.fi
http://iki.fi/hsivonen/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 23 '05 #4
On Mon, 27 Dec 2004 01:41:41 +0200, Henri Sivonen wrote:
Defaulting the namespace in the DTD is an extremely bad idea considering
DTDless parsing.


ITYM external-subset-less parsing, but your point is taken. Externally
defaulted attribute specifications are always problematic in XML.

Needless to say, namespaces are an even worse idea.
Jul 23 '05 #5
In article <hs****************************@news.dnainternet.n et>,
Henri Sivonen <hs******@iki.fi> writes:
There's not much point in all of this except in the wider XML
perspective,
Defaulting the namespace in the DTD is an extremely bad idea considering
DTDless parsing.


It's XHTML being schizophrenic as usual. If it's HTML then it had better
default the namespace in the DTD. If it's XML, it had better not.

WML does it too, and really has no excuse.
It appears they think a URL should show the year it was minted. Not very
useful here.


If indeed that's what they mint. Too much design by committee.

--
Nick Kew
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by chris | last post: by
4 posts views Thread by nobody | last post: by
1 post views Thread by David Tucker | last post: by
81 posts views Thread by Michael Rozdoba | last post: by
reply views Thread by Frederick Noronha \(FN\) | last post: by
9 posts views Thread by wardy1975 | last post: by
7 posts views Thread by Richard Phillips | last post: by
2 posts views Thread by =?ISO-8859-1?Q?J=2E_Pablo_Fern=E1ndez?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.