![]() |
|
||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
|
|
#1 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
I'm reading XHTML Black Book and there saying that using DTD files in a directory is better...
So should I use DTD files in a directory? (I never seen a website do that)...? It looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd"> TY for reading. |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
that is NOT a valid DTD anyway. It is only a partial DTD and is as much use as not having one at all.
Not sure what a directory has to do with though, maybe you need to re-read it and explain exactly what they mean. |
|
|
|
|
|
#3 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
Here's the exact text of the paragraphs from the book:
Here's one thing to note: I'm giving the full URL of the various DTD files in these <!DOCTYPE> elements, which means that the browser has to fetch the full DTD file from the W3C before it can check your coument. If everyone did that, W3C would be swamped as millions of browsers tried to read the same files. To prevent that, you can copy the DTD files from those URLs and place local copies on your Web Site. For example, if you place the DTD files in a directory named DTD in your Web site, your <!DOCTYPE> elements might look more like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd"> |
|
|
|
|
|
#4 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
Okay I see what it is getting at.
It is completely WRONG BTW, browsers DO NOT look at the W3c site for the actual document each time a page is viewed or validated. They have the standard specification built in to the browser and have no need to "look it up" IF you wanted to have a custom DTD, ie: you have rewritten a ECMA (javascript) method definition and your site relies on this, THEN you should have the URL pointing to the modified document on your site so browsers can pick it up and use the newly defined behaviour. BUT, and this another point where your "Black Book" is incorrect. The URLs defined there would ONLY work IF and WHEN the document was on the same level or above the DTD folder. IF your document was in a subfolder of your site it would not be able to locate the definition document. |
|
|
|
|
|
#5 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
hmmm I see; TY for pointing that out. Is there a benefit/advantage if you have a custom DTD or put a DTD in your directory?
|
|
|
|
|
|
#6 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
bump
-Bumping Up My P0st |
|
|
|
|
|
#7 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
Nope. ..
|
|
|
|
|
|
#8 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
K TY; you helped allot...
|
|
|
|
|
|
#9 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
The book later says:
You can even omit the <!DOCTYPE> element, but then your XHTML is not strictly-confronting XHTML. My guess for the longer term is that true XHTML browsers will have the XHTML DTDs built-in, and will be able to validate documents against them without having to fetch those DTDs at all. -So is this what you mean by browsers having DTDs build in; because this book was made in 2001-2002. |
|
|
|
|
|
#10 |
|
WLC Member
Join Date: Sep 2008
Posts: 10
|
bump
-Bumping Up My P0st |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
Linear Mode |
|
|