Re: Attribute Comparison Selectors

ben wrote:

> I'm working on a timeline project in markup language (HTML currently, 
> but I was considering expanding to XML)
> 
> I'd like to be able to color code the events.  This can, of course, be 
> done with CSS as it is currently, by assigning each era a specific value 
> of an attribute (either class or some custom attribute). However, it 
> seems like the ideal way to do it would be to have a date attribute, 
> (this much can be done in XML)  and have a css selector that can do 
> things like ranges.  Currently, selectors only allow for checking to see 
> if an attribute exists, if it is a particular string, or if it contains 
> (or starts with or ends with) a particular string. What I would propose 
> would be a selector for numerical attributes only, something like this:
> 
> *[attribute|>number|<number]
> 
> So, for example, if I were to markup
> 
> event[date|>1849|<1914] {background: #00ff00;}
> 
> Any event between 1849 and 1914 would have a green background.
> 
> Just a thought...  do with it as you see fit.

I see perfectly why you want such a feature, and why it is a legitimate
request. But I hate your proposed syntax, really...

I have this feeling that if we start allowing such things in CSS,
you'll soon need much more than that. For instance, real date comparison
(is datetime > "Mon 20 March 2006, 01:02am PST" )...

</Daniel>

Received on Monday, 20 March 2006 09:03:13 UTC