DOCTYPES, Validating, Empty Tags and &s.
I wanted to share a little bit of what I've learned so far, as I haven't seen all of the info in one place.
Feel free to correct me, and add any information on the direction the Dev Team is taking and give guidance to
those of us working on themes, hacks and mods.
The classic template.html lists HTML 4.01 Transitional as its DOCTYPE.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
The classic template.html from the current source tree of 1.4 is XHTML 1.0 Transitional.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Which is consistent with the discussions I've seen stating the goal of XHTML 1.0 Transitional for CPG 1.4.
I am assuming that since 1.32's DOCTYPE is listed as 4.01 Transitional that the rest of the code was built with that DOCTYPE in mind.
The problem is that the new EMPTY TAG notation confuses the validators for HTML 4.01 Transitional.
As can be expected the pages don't validate as XHTML either, since there are many Empty Tags are missing the new notation.
I don't expect this to be fixed in 1.32 since it's a lot of work and 1.32 is done. Just wanted to point out to other theme developers that
it's probably unrealistic to try and write a XHTML 1.0 Trans Theme and have it validate using 1.32 code. And right now unless you wanted to go through
and replace all the " /> tag notation its not realistic to write a 4.01 Transitional theme that validates with the 1.32 code either.
Does it matter, probably not, browsers seem to be rendering the 1.32 code just fine.
One thing I wan't to warn other folks about is that the empty tag notation such as <hr /> that
is becoming more popular as XHTML takes hold is that it is NOT meant to replace normal end tags on
every HTML statement. So don't do a search and replace of ">" with " />" on your pages.
This is the best document I've found that explained what the notation is actually used for (One of my AHA! moments).
http://www.cs.tut.fi/~jkorpela/html/empty.htmlBasically if normal html tags enclose data they are not an EMPTY tag.
i.e.:
<p> DATA </p>
<h1> Heading </h1>
Are not empty tags. There's a <begining> content and </ending>
However:
<hr>
<br>
Are EMPTY tags because they don't surround any data.
<IMG src="blank.gif">
Is ALSO an EMPTY Tag because it doesn't surround any data. (it did sneak some in, but INSIDE the tag itself)
Only EMPTY TAGS woulde be written as:
<hr/>
<br/>
<img src="blank.gif"/>
However this notation has confused a lot of browsers so the W3c came out with a recomendation to use whitespace before the end tag
which results in:
<hr />
<br />
<img src="blank.gif" />
Which in turn, causes your pages to not Validate as proper HTML 4.01 Transitional nor 4.01 Strict.
XHTML 1.0 Transitional should work. A lot of other validaton issues with 1.32 code, I expect most of those getting worked out by the dev team for 1.4. (Thanks Guys)
This notation won't validate as XHTML 1.0 Strict. (Not particularly a goal for Coppermine at this point).
Which brings me to my last point $amp;s.
Technicanlly speaking when you encode a url in html &'s should be replaced by &'s.
There's a ton of 'em inside the 1.32 code and throughout the themes.
so something like <a href src="index.asp?cat=0&theme=classic">Link</a> should be re-written as:
<a href src="index.asp?cat=0&theme=classic">Link</a>
You will have XHTML 1.0 Transitional Validation problems with the former notation claiming "entities aren't defined".