implicit-element is a better name than root
tests.lisp
Sat Dec 5 07:18:05 UTC 2009 pix@kepibu.org
* implicit-element is a better name than root
Also add a bit of support for sibling combinators when dealing with the
implicit element, and note a problem that crops up when dealing with
selections on a non-root element (should a simple-selector select the
element, or is there an implicit descendant combinator?).
--- old-Oh, Ducks!/tests.lisp 2013-07-07 01:41:17.000000000 +0000
+++ new-Oh, Ducks!/tests.lisp 2013-07-07 01:41:17.000000000 +0000
@@ -79,16 +79,21 @@
(first q))
i))
-;; Note, however, that searches are strictly recursive. So a sibling
-;; combinator won't match.
-;; FIXME: should it?
+;; siblings will also match, thanks to a bit of ugly code
(match (#T(html (:model dom)
("q" . ?q))
- "<div><i>ham</i> foo <q>bar <i>baz</i></q> quuz <i>spam</i></div>")
+ "<div><i>ham</i> foo <q>bar <i>baz</i></q> quuz <i>spam</i><q></q><i>not match</i></div>")
(match (#t(html ("+ i" . ?i))
(first q))
i))
+(match (#T(html (:model dom)
+ ("q" . ?q))
+ "<div> foo <q>outer q <i>baz <q>inner q</q></i></q> quuz</div>")
+ (match (#t(html ("q" . ?i))
+ (first q))
+ i))
+
#+LATER?
(match (#t(html ("div::content" . #t(regexp+ "^f(o+)" (?o))))