xpath-experiment

changeset 9:5e397595b84b tip

Changed a bit the testcase to uncover another bug
author Emanuele Aina <em@nerd.ocracy.org>
date Sun Mar 08 22:50:52 2009 +0100 (16 months ago)
parents b7ff25363bc0
children
files Makefile XPathExperiment.cs test.xml
line diff
     1.1 --- a/Makefile	Mon Dec 01 14:55:00 2008 +0100
     1.2 +++ b/Makefile	Sun Mar 08 22:50:52 2009 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4  EXE := XPathExperiment.exe
     1.5  REFERENCES := $(addprefix -r:, System.Core)
     1.6  TEST_FILE := test.xml
     1.7 -TEST_EXPR := '//_:div//_:div//_:div'
     1.8 +TEST_EXPR := '//_:div//_:div'
     1.9  
    1.10  MCS := gmcs
    1.11  MONO := mono --debug
     2.1 --- a/XPathExperiment.cs	Mon Dec 01 14:55:00 2008 +0100
     2.2 +++ b/XPathExperiment.cs	Sun Mar 08 22:50:52 2009 +0100
     2.3 @@ -39,7 +39,7 @@
     2.4  
     2.5          string xpath = args[1];
     2.6  
     2.7 -        var nodes = doc.SelectNodes(xpath, ns);
     2.8 +        var nodes = doc.SelectSingleNode("//_:html", ns).SelectNodes("."+xpath, ns);
     2.9  
    2.10          Console.WriteLine("MATCHES: {0}", Count(nodes.ToList()));
    2.11          Console.WriteLine("MATCHES (distinct): {0}", Count(nodes.ToList().Distinct()));
     3.1 --- a/test.xml	Mon Dec 01 14:55:00 2008 +0100
     3.2 +++ b/test.xml	Sun Mar 08 22:50:52 2009 +0100
     3.3 @@ -2,11 +2,11 @@
     3.4  <body>
     3.5  <div id="e1">
     3.6      <div id="e1.1">
     3.7 -        <div id="e1.1.1">
     3.8 -            <div id="e1.1.1.1">
     3.9 -                <div id="e1.1.1.1.1"/>
    3.10 -            </div>
    3.11 -            <div id="e1.1.1.2"/>
    3.12 +        <div id="e1.1.1"/>
    3.13 +        <div id="e1.1.2">
    3.14 +          <div id="e1.1.2.1">
    3.15 +              <div id="e1.1.2.1.1">e1.1.2.1.1</div>
    3.16 +          </div>
    3.17          </div>
    3.18      </div>
    3.19  </div>

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.