Re: Check existence of class names

On Tue, 17 Aug 2010 20:51:22 +0300, Philip Taylor (Webmaster, Ret'd) <P.Taylor@rhul.ac.uk> wrote:

> Is not easy, Vladimir, since it is not really a question of language
> (your English is absolutely fine).  It's more really about a way

Thanks.

> of thinking : if you use a class name in an HTML file, then does
> that class really exist ?  I would answer "yes", but I think that

I would say the class is declared. Some languages use the term
'defined', some 'constructed' for what is needed before a declared
thing (object, variable, class...) starts to exist. And if a thing is
used when it does not exist, a default way of creating it (after
looking in the external places) is performed.

Why do you dislike this kind of terminology?

> you might answer "no, unless there is some other place that the
> class name occurs".  In that case, I think the best name for it
> would be a "unique" class name : one that occurs in one place and
> one place only.  Is that the idea that you want to convey ?

No. I really want to distinguish the defined/constructed classes
(plus preexisting classes like p) from the names used accidentally
due to typing errors. The definition might be in a different linked
file.

Consider something like the following with the definition in
the same file.
...
<style type="text/css">
physicists chemists {...}
</style>
...
<span class="physicist">Albert Einstein</span> ...
<span class="chemist">Dmitry Mendeleev</span> ...
<span class="physisists">Christiaan Huygens</span> ...
<span class="physicists">J.J. Thomson</span> ...
<span class="physisists">Niels Bohr</span> ...
...

class="physisists" is not unique but is in err. Therefore "unique"
is not a good choice for the term. IMHO. YMMV.

> ** Phil.
> --------

-- 
Vladimir Chukharev
Tampere University of Technology

Received on Tuesday, 17 August 2010 20:38:13 UTC