[Mapcss] Strings and Keywords
Sebastian Klein
bastikln at googlemail.com
Mon Jul 19 14:00:43 BST 2010
Andrew O. Shadoura wrote:
> Hello.
>
> On Monday 19 July 2010 14:43:46 Sebastian Klein wrote:
>> what is the difference between strings and keywords and how are they
>> processed?
>
> I think, there should be no difference between them. The keyword itself is a
> string. If a string doesn't have non-keyword characters, it can be used
> without quotes.
I think there is an agreement to start from css (because it is widely
used and well supported) and only deviate when there is a reason.
In this case the reason could be that it is easier to implement. ;)
In css it is an error to write
color: "red";
because red is a keyword:
http://www.w3.org/TR/CSS21/syndata.html#keywords
>> Another example would be the yes keyword in conditions. I'd say
>> [oneway=yes] applies to a oneway tag with value yes, true or 1, but
>> [oneway="yes"] matches the literal
>> value "yes", only.
>
> My opinion on this is that we shouldn't do any magic, and that "yes" should be
> the only "yes" but not "1" or "true". For "magic" comparison I'd write
> something like boolean(oneway)=true, like in eval().
It is more or less a part of MapCSS 0.1 and 0.2. I don't like it that
much either, but with quotes it would at least be possible to suppress
the magic.
>> As keywords (unlike strings) are case insensitive, [oneway=Yes] would
>> work, but [Oneway=yes] or [oneway="Yes"] would not apply to a onway=yes
>> tag.
>
> Case insensivity is bad, I think.
Yes, but it is not a matter of opinion:
http://www.w3.org/TR/CSS21/syndata.html#characters
(Unless we agree that it is reasonable to differ from css in this point.)
Sebastian
More information about the Mapcss
mailing list