css3-selectors

changeset 69:fe189fede98d

Added the non-standard != attribute string matcher
author Emanuele Aina <em@nerd.ocracy.org>
date Tue Dec 30 18:36:08 2008 +0100 (19 months ago)
parents 18d0c408131f
children 0c04c468e014
files Css3SelectorExperiment.cs
line diff
     1.1 --- a/Css3SelectorExperiment.cs	Tue Dec 30 17:44:48 2008 +0100
     1.2 +++ b/Css3SelectorExperiment.cs	Tue Dec 30 18:36:08 2008 +0100
     1.3 @@ -94,6 +94,8 @@
     1.4                  // TODO: add the ends-with() XPath function
     1.5                  case "$=": return String.Format("[ends-with(@{0},'{1}')]", Attribute, Value);
     1.6                  case "*=": return String.Format("[contains(@{0},'{1}')]", Attribute, Value);
     1.7 +                // NOTE: non-standard!
     1.8 +                case "!=": return String.Format("[not(@{0}='{1}')]", Attribute, Value);
     1.9              }
    1.10              throw new Exception();
    1.11          }
    1.12 @@ -206,7 +208,7 @@
    1.13              // pseudo classes
    1.14              new[]{@"^:([a-z0-9_-]+)(\((.*)\))?", "Pseudo" },
    1.15              // attribute value match
    1.16 -            new[]{@"^\[\s*([^~\|^$*=\s]+)\s*(([~\|^$*]?=)\s*(.+))?\]", "Attr"},
    1.17 +            new[]{@"^\[\s*([^\~\|^$*!=\s]+)\s*(([~\|^$*!]?=)\s*(.+))?\]", "Attr"},
    1.18              // adjacency/direct descendance
    1.19              new[]{@"^\s*([>+\~\s])\s*", "Combinator"},
    1.20              // rules union 

To download these repositories, get Mercurial and then type something like:

hg clone http://techn.ocracy.org/repository-name/

You can also click the "zip" or "gz" links to get an archive of the latest revision without installing anything.

The change logs of the repositories are aggregated at techn.ocracy.org/planet.

We have also some darcs repositories at techn.ocracy.org/darcs.