Re: OPINIONS WANTED: regexps in CSS?

Frank Boumphrey writes:
 > >>Only the "advanced" users are going to be inventing DTDs for their XML yet
 > this has been accepted by the W3C. For the more complicated features, the
 > less advanced users will simply use authoring tools which write the regexp
 > for them.<<
 > 
 > This discussion has centered on the user, but remember the developer.
 > One of the nice things in the XML spec was that it was stated
 > "It shall be easy to write programs for XML"
 > 
 > If regexp  becomes part of the CSS specification, then a whole new layer of
 > complexity is added to any program that is written for the standard, and
 > automatically it means that only those companies that have the resources can
 > support them. That means that prices go up etc. etc.

On a related note, a programmer here noted that regexps could become
quite costly in execution time as well. For a very simple document (3
paragraphs, 6 list items, 2 classes, and the sample style sheet from
the spec + 2 more rules), there were already some 70,000 comparisons
involved in matching selectors against elements. At the moment they
are all hashcodes (i.e., comparing one integer against another), so
they are fast, but you can imagine what will happen if some of the
selectors contain regexps.


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 93 65 76 92            06902 Sophia Antipolis Cedex, France
  +33 (0)4 92 38 76 92 (<--- after 5 Jan 1998)

Received on Wednesday, 11 March 1998 09:45:12 UTC