472,981 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1325
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: chris | last post by:
Hi, Does anyone know where you can get a copy of html and xhtml dtds? Saxon wants to grab them off the net each time, but by using a catalog and NWalshs' resolver you can get it to look for...
4
by: nobody | last post by:
hello! do you know of any (free) preprocessor able to deal with DTDs? I'dlike to do things as #define with_b ... <!ELEMENT a (#PCDATA)> <!ELEMENT c (#PCDATA)>
4
by: Clifford W. Racz | last post by:
I am an XML author and I am needing to do some SGML work as well. I am using James Clark's SP (SX) to transform my SGML source into an XML source for use with XSLTs. I am needing to write XSLTs...
1
by: David Tucker | last post by:
i have an xml document that needs to use multiple dtds. each dtd may have the same element names in general but some will differe slightly. I want to use namspaces but every time I do so it...
81
by: Michael Rozdoba | last post by:
I've been wandering around the results of numerous googles for several hours without reaching a conclusive solution, so I'm dipping a tentative toe back in ciwah... I've been persuaded here in...
0
by: Frederick Noronha \(FN\) | last post by:
---------- Forwarded message ---------- Solutions to Everyday User Interface and Programming Problems O'Reilly Releases "Access Cookbook, Second Edition" Sebastopol, CA--Neither reference book...
9
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a...
7
by: Richard Phillips | last post by:
Hello, Does anyone else out there have a copy of this? I'm working through my copy and have discovered that it has no chapter 11... Pages 341-388 are just not there! Anyone else able to check...
2
by: =?ISO-8859-1?Q?J=2E_Pablo_Fern=E1ndez?= | last post by:
Hello, Is ElementTree supposed to load DTDs? I have some xmls heavy on entities and it fails this way: Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) on linux2 Type "help", "copyright",...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.