<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,6 +18,8 @@ module Nokogiri
   class &lt;&lt; self
     attr_accessor :error_handler
 
+    ###
+    # Parse an HTML or XML document.  +string+ contains the document.
     def parse string, url = nil, encoding = nil, options = nil
       doc =
         if string =~ /^\s*&lt;[^Hh&gt;]*html/i # Probably html
@@ -37,6 +39,21 @@ module Nokogiri
       end
     end
     
+    ###
+    # Parse a document and add the Slop decorator.  The Slop decorator
+    # implements method_missing such that methods may be used instead of CSS
+    # or XPath.  For example:
+    #
+    #   doc = Nokogiri::Slop(&lt;&lt;-eohtml)
+    #     &lt;html&gt;
+    #       &lt;body&gt;
+    #         &lt;p&gt;first&lt;/p&gt;
+    #         &lt;p&gt;second&lt;/p&gt;
+    #       &lt;/body&gt;
+    #     &lt;/html&gt;
+    #   eohtml
+    #   assert_equal('second', doc.html.body.p[1].text)
+    #
     def Slop(*args, &amp;block)
       Nokogiri(*args, &amp;block).slop!
     end</diff>
      <filename>lib/nokogiri.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,21 +12,32 @@ module Nokogiri
         def set_cache setting
           @cache_on = setting ? true : false
         end
+
         def cache_on?
           @cache ||= {}
           instance_variable_defined?('@cache_on') ? @cache_on : true
         end
+
         def check_cache string
           return unless cache_on?
           @cache[string]
         end
+
         def add_cache string, value
           return value unless cache_on?
           @cache[string] = value
         end
+
         def clear_cache
           @cache = {}
         end
+
+        def without_cache &amp;block
+          tmp = @cache_on
+          @cache_on = false
+          block.call
+          @cache_on = tmp
+        end
       end
       alias :parse :scan_str
 </diff>
      <filename>lib/nokogiri/css/parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,8 @@
 module Nokogiri
   module Decorators
+    ###
+    # The Slop decorator implements method missing such that a methods may be
+    # used instead of XPath or CSS.  See Nokogiri.Slop
     module Slop
       def method_missing name, *args, &amp;block
         if args.empty?
@@ -13,7 +16,11 @@ module Nokogiri
             list = xpath(&quot;./#{name}#{conds}&quot;)
           end
         else
-          list = css(&quot;#{name}#{args.first}&quot;)
+          CSS::Parser.without_cache do
+            list = xpath(
+              *CSS.xpath_for(&quot;#{name}#{args.first}&quot;, :prefix =&gt; &quot;./&quot;)
+            )
+          end
         end
         
         super if list.empty?</diff>
      <filename>lib/nokogiri/decorators/slop.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,6 +49,25 @@ class TestNokogiri &lt; Nokogiri::TestCase
   &lt;/html&gt;
   END
 
+  def test_slop_css
+    doc = Nokogiri::Slop(&lt;&lt;-eohtml)
+    &lt;html&gt;
+      &lt;body&gt;
+        &lt;div&gt;
+          one
+          &lt;div class='foo'&gt;
+            div two
+            &lt;div class='foo'&gt;
+              div three
+            &lt;/div&gt;
+          &lt;/div&gt;
+        &lt;/div&gt;
+      &lt;/body&gt;
+    &lt;/html&gt;
+    eohtml
+    assert_equal &quot;div&quot;, doc.html.body.div.div('.foo').name
+  end
+
   def test_slop
     doc = Nokogiri::Slop(SLOP_HTML)
 </diff>
      <filename>test/test_nokogiri.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ffac3c78ef98588d9ffe3e6e46339dd73d92ce8b</id>
    </parent>
  </parents>
  <author>
    <name>Aaron Patterson</name>
    <email>aaron.patterson@gmail.com</email>
  </author>
  <url>http://github.com/tenderlove/nokogiri/commit/8b9daefbcc1635414ddb991b328755c3783615cb</url>
  <id>8b9daefbcc1635414ddb991b328755c3783615cb</id>
  <committed-date>2008-11-30T22:19:58-08:00</committed-date>
  <authored-date>2008-11-30T22:19:58-08:00</authored-date>
  <message>making sure that sloppy css selectors do not descend too far</message>
  <tree>a3091bd5ea7fa8038a0eb023f7cedf22dbdfe20b</tree>
  <committer>
    <name>Aaron Patterson</name>
    <email>aaron.patterson@gmail.com</email>
  </committer>
</commit>
