Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Won't validate...why not?

Reply
Thread Tools

Won't validate...why not?

 
 
Lauri Raittila
Guest
Posts: n/a
 
      11-29-2004
in alt.html, Liz wrote:
> Lauri Raittila <(E-Mail Removed)> wrote:


> > 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.


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...


--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
 
Reply With Quote
 
 
 
 
Neal
Guest
Posts: n/a
 
      11-29-2004
On Mon, 29 Nov 2004 17:59:08 -0000, nice.guy.nige
<(E-Mail Removed)> wrote:

> While the city slept, Liz ((E-Mail Removed)) 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>


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>.
 
Reply With Quote
 
 
 
 
Liz
Guest
Posts: n/a
 
      11-29-2004
In message <opsh8jwxrs06el5p@stevepughlaptop>
"Steve Pugh" <(E-Mail Removed)> wrote:


> 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

--
Virtual Liz now at http://www.v-liz.com
Kenya; Tanzania; Namibia; India; Seychelles; Galapagos
"I speak of Africa and golden joys"
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      11-30-2004
Lauri Raittila wrote:

> 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.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Lauri Raittila
Guest
Posts: n/a
 
      11-30-2004
in alt.html, Toby Inkster wrote:

> 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?

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      11-30-2004
Lauri Raittila wrote:

> 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.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments