Won't validate...why not?

L

Liz

In message <[email protected]>
I'm taking a br.

Hahahaha
Don't get me started.
I realise that it's a pretty specialised interest, but quite a few of my and
many other people's webpages are lists of birds seen in a particular area
(but this would apply to long lists of everything else).

In the form:
Birds seen at (birdy place) during (month, year)
<b>Vernacular name</b><i>scientific name</i><br>
(Yes, I know it's harking back to Gutenburg, but birders in the UK at least
expect to see bird lists written like that, bold and italic. It makes it
much, much easier to read/take in. Very few birders give a Castlemaine
4X about the w3c. And many/most will print out the list.)
But to write strict I'd need to write <br /> every time.
That's adding a helluvalotta bytes on a long list for no good that I can
see, except that someone thought it up one day on a whim ('to make things
consistent').

And another thing - why on earth did 'they' decide on all that, e.g.
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
and
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
Why couldn't they just have decreed, e.g.
<!4.01T/En t/h 8859-1>
If they'd decreed it, it would have been so.

Slainte

Liz
 
S

Steve Pugh

Birds seen at (birdy place) during (month, year)
<b>Vernacular name</b><i>scientific name</i><br>
But to write strict I'd need to write <br /> every time.

No you don't.
That's adding a helluvalotta bytes on a long list for no good that I can
see, except that someone thought it up one day on a whim ('to make things
consistent').

1. If it's a list then you should use list markup.
2. <br /> is perfectly fine in XHTML 1.0 Transitional and <br> is
perfectly fine in HTML 4.01 Strict. You seem to have become confused
between Strict/Transitional and XHTML/HTML.

Steve
 
N

nice.guy.nige

While the city slept, Liz ([email protected]) feverishly typed...
Birds seen at (birdy place) during (month, year)
<b>Vernacular name</b><i>scientific name</i><br>

<strong>Vernacular name 1</strong> <em>scientific name 1</em><br>
<strong>Vernacular name 2</strong> <em>scientific name 2</em><br>

or more correctly

<ul>
<li><strong>Vernacular name 1</strong> <em>scientific name 1</em>
<li><strong>Vernacular name 2</strong> <em>scientific name 2</em>
</ul>

or even more correctly

<ul>
<li><strong>Vernacular name 1</strong> <em lang="la">scientific name
1</em>
<li><strong>Vernacular name 2</strong> <em lang="la">scientific name
2</em>
</ul>

;-)

Cheers,
Nige
 
L

Liz

In message <[email protected]>
or even more correctly

<ul>
<li><strong>Vernacular name 1</strong> <em lang="la">scientific name
1</em>
<li><strong>Vernacular name 2</strong> <em lang="la">scientific name
2</em>
</ul>

;-)

My point, exactly.
How stupid and wasteful would that be?
- You clearly agree ;-)
And it's not actually 'strong' or 'emphasised'.
It really is 'presentational' - for the reader's convenience.
(not necessary for a 'listener only')
Why didn't "they" just accept <b> and <i>?
Compacter and makes more sense.

Liz
 
D

David Dorward

Liz said:
And another thing - why on earth did 'they' decide on all that, e.g.
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
and
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">

They didn't. The <meta> technique of specifying a character encoding is very
hackish and not recomended. The correct place for such information (in an
web context) is in the HTTP header (where the user agent can get the
information *before* trying to read the document).
 
L

Liz

In message <[email protected]>
David Dorward said:
They didn't. The <meta> technique of specifying a character encoding is very
hackish and not recomended.
Tx for this info.
I obviously read the meta method somewhere: I'd never have thought up that
for myself.
The correct place for such information (in an web context) is in the HTTP
header (where the user agent can get the information *before* trying to read
the document).
Does that mean you just start <HTTP-...> straight after the Doctype
declaration...

or...?

Tx

Liz
 
L

Liz

In message <[email protected]>
No. You set your server to send it. You don't write anything in yout HMTL
document.
Well that's totally beyond me, so the 'hack' will just have to do for the
time being. I have no interest in setting servers or anything else like that.

If you ask me, it's all part of the attempt to 'elitise' the net.
(Like reading the w3c website)
I thought the web was supposed to be for 'the people', but clearly only for
the people with more time than me to keep checking out these things.
Us lesser mortals just get a book...or ten...and hope they tell us right.

Slainte & tx for the info.

Liz
 
L

Lauri Raittila

Well that's totally beyond me, so the 'hack' will just have to do for the
time being. I have no interest in setting servers or anything else like that.

It is not that hard *if* your server is Apache and .htaccess is allowed
If you ask me, it's all part of the attempt to 'elitise' the net.
(Like reading the w3c website)

No it isn't. It is very sencible that content encoding should be set
before actually reading content. As it might just as well be in encoding
that makes impossible to read the embedded encoding information.
I thought the web was supposed to be for 'the people', but clearly only for
the people with more time than me to keep checking out these things.

Well, it was. Orginally, you weren't supposed to ever need to type URLs.
But there still is no common server/editor relationships, which would
take care of encoding information etc.

I have been thinking that it would make sence to write script that would
write .htaccess based on meta http tags on pages, but as my server
doesn't allow such things in .htaccess, it is pointless...
 
N

Neal

While the city slept, Liz ([email protected]) feverishly typed...


<strong>Vernacular name 1</strong> <em>scientific name 1</em><br>
<strong>Vernacular name 2</strong> <em>scientific name 2</em><br>

Are you intending to over-emphasize the vernacular over the
still-emphasized scientific? Is this even really a case of emphasis, or a
case of using appropriate style?

<strong> and <em> are definitely inappropriate here. If you have some sort
of aversion to <b> and <i> (similar to how some, because it's
inappropriate for page layout, totally abandon table markup even for true
tables) then use <span>.
 
L

Liz

In message <opsh8jwxrs06el5p@stevepughlaptop>
1. If it's a list then you should use list markup.
Still adding extra bytes for no good reason - that I can see.
2. <br /> is perfectly fine in XHTML 1.0 Transitional and <br> is
perfectly fine in HTML 4.01 Strict. You seem to have become confused
between Strict/Transitional and XHTML/HTML.
That's true enough.
I was beginning to wonder as the post was going up.
It's all too, tooooo much.

Tx & slainte

Liz
 
T

Toby Inkster

Lauri said:
I have been thinking that it would make sence to write script that would
write .htaccess based on meta http tags on pages, but as my server
doesn't allow such things in .htaccess, it is pointless...

Better would be an HTML pre-processor module for Apache that extracted
character encoding information from meta tags and included it as HTTP
headers.
 
L

Lauri Raittila

Better would be an HTML pre-processor module for Apache that extracted
character encoding information from meta tags and included it as HTTP
headers.

Is there somewhere some information about pre-processor modules? Or is
there such already? Or would it still parse the file each time?

If this is not impossible to do, I wonder why no-one has done it yet?
 
T

Toby Inkster

Lauri said:
Is there somewhere some information about pre-processor modules? Or is
there such already?

Apache modules load into the Apache server itself -- like mod_php does, or
mod_ssl.

This makes them the most CPU-efficient way of server-side processing.

However, writing an Apache module is a pain -- it would (realistically)
need to be written in C(++?) and be compiled against the Apache source
code.
Or would it still parse the file each time?

You could write it in such a way that results are cached in memory between
requests. As the module becomes *part* of Apache, it can hold stuff in
memory between requests.
If this is not impossible to do, I wonder why no-one has done it yet?

Probably not sufficient demand.

A less efficient, but easier, thing to do would be to create a "handler"
for the text/html content type using httpd.conf or .htaccess. This handler
could be written in whatever language you like, e.g. Perl.

As an example, I wrote a handler for all files with a name ending in
".strict". Source code is below. It simply adds on a doctype and makes a
few substitutions here and there before sending it to the browser.

------------------------------ strict.cgi ------------------------------
#!/usr/bin/perl

# strict.cgi v 1.1
# Copyright 2004 Toby Inkster
# May be used, modified and redistributed under the terms of the GNU GPL.
# http://www.gnu.org/copyleft/gpl.html

$file = $ENV{'PATH_TRANSLATED'};
$date = `date --utc --rfc-2822 --reference='$file'`; chomp $date;
$etag = $size . 'e-a-' . `date --utc --reference='$file' '+\%s'`; chomp $etag;

$icon = <<EOF;
<div>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-html401"
alt="Valid HTML 4.01!" height="31" width="88"></a>
</div>
EOF

$cssicon = <<EOF;
<div>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!"></a>
</div>
EOF

$txt = `cat '$file'`;

$txt =~ s/\$ICON\$/$icon/g;
$txt =~ s/\$CSSICON\$/$cssicon/g;

$txt = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
. "\n"
. $txt;

$size = length($txt);

print "Content-Type: text/html; charset=utf-8\n";
print "Content-Length: $size\n";
print "Last-Modified: $date\n";
print "ETag: $etag\n";
print "\n";
print $txt;
------------------------------ /strict.cgi -----------------------------

and add this to your .htaccess file

------------------- .htaccess -------------------
Action strict /strict.cgi
AddHandler strict .strict
AddType text/html .strict
------------------- /.htaccess ------------------

Then you can write strict HTML 4.01, but leave out the doctype, and
include the tokens $ICON$ to insert a validation icon and $CSSICON$ to
include a CSS validation icon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top