Is class="//foo.bar" problems?

L

Lauri Raittila

I have been planning about making a preprosessor that wouldn't require
two sets of files, but would alter one. (haven't seen one anywhere yet)

So I have been thinking about how to include file. It would be easy¹ to
make include to work so that when there is class="//foo.bar" on some
element, it's contents would be replaced by file foo.bar². If I
understood HTML4 spec correctly, there is no limitatin on what chars to
use in class name.

Should I expect some problems on some browser when using classes with non
alphanumric chars? Does it make difference on what chars to use?

Test URI:
http://www.student.oulu.fi/~laurirai/test/class.html

Works on Opera 7.21RC3, Mozilla 1.0 and IE5.5 as well as Elinks 0.3.2 and
Lynx 2.8.5dev.7

[1] In fact I already made perl script for that. (On my first day using
perl - nice language indeed)
[2] and class="//..foo/bar.baz" to open file from that path, later.
 
B

brucie

It would be easy¹ to make include to work so that when there is
class="//foo.bar" on some element, it's contents would be replaced by file
foo.bar². If I understood HTML4 spec correctly, there is no limitatin on
what chars to use in class name.

why do you want to introduce a potential problem where none need
exist?
Should I expect some problems on some browser when using classes with non
alphanumric chars?

it wouldn't surprise me if there were browsers that got upset so why
do it?
 
T

Toby A Inkster

Lauri said:
[1] In fact I already made perl script for that. (On my first day using
perl - nice language indeed)

Well, if you convert the 'class="//blah"' to an include file at the server
side, the browser never sees it anyway.
 
L

Lauri Raittila

Toby A Inkster said:
Well, if you convert the 'class="//blah"' to an include file at the server
side, the browser never sees it anyway.

No, if I set it to include just it's content of that element. There is no
problem at all, if I make it to different file.
 
L

Lauri Raittila

why do you want to introduce a potential problem where none need
exist?

I don't want. That's why I'm asking. I can do it differently. I just need
to do that.

The include file thing is not going to be only reason why I do such thing
to some element with some class - I'm intending to make system that will
generate menu from html files in same subdirectory and their meta
descriptions.
Since that is bigger job, I tested my algorithm on include. And if that
works, I did't see reason to not use it.

I didn't think semantic question at all last night (on 5am) at all. I'm
trying it now, but can't really say if my intended usage is against spec.
(but I'm propably biased.)
it wouldn't surprise me if there were browsers that got upset so why
do it?

I can't see any reason at all there would be any problems. Since it is
valid it should work on all well done browsers, and tag soup slurpers
generally couldn't care less. But, you are propably right. Somebody
always got it wrong.

Only thing I could think to be problem, is using multible classes and
using CSS to same element.

The last thing is some is one of the reasons I am propably giving up this
idea - I don't want to drop support of any browser for my preprosessing
tool, nor use any extra markup.
 

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
474,082
Messages
2,570,589
Members
47,212
Latest member
JaydenBail

Latest Threads

Top