Add element-content as a prereq to matching on an element's textual content
Annotate for file /traversal/pt.lisp
2009-11-18 pix 1 (in-package #:oh-ducks.traversal)
2009-11-13 pix 2
2009-11-23 pix 3 (defmethod unify::occurs-in-p ((var symbol) (pat chtml:pt) env)
2009-12-03 pix 4 (declare (ignore var pat env))
2009-11-23 pix 5 nil)
11:54:01 ' 6
2009-11-13 pix 7 ;;; general accessors
04:19:11 ' 8
2009-11-13 pix 9 (defmethod element-children ((element chtml:pt))
2009-11-30 pix 10 (remove-if (compose (rcurry #'member '(:pcdata :comment) :test #'eq) #'chtml:pt-name)
2009-11-21 pix 11 (chtml:pt-children element)))
2009-11-13 pix 12
2009-11-13 pix 13 (defmethod element-parent ((element chtml:pt))
2009-11-13 pix 14 (chtml:pt-parent element))
04:19:11 ' 15
2009-11-13 pix 16 (defmethod element-attribute ((element-attribute symbol) (element chtml:pt))
2009-11-30 pix 17 (getf (chtml:pt-attrs element) element-attribute))
2009-11-13 pix 18 (defmethod element-attribute ((element-attribute string) (element chtml:pt))
05:19:55 ' 19 (element-attribute (intern (string-upcase element-attribute) :keyword) element))
2009-11-13 pix 20
2009-11-13 pix 21 (defmethod element-type ((element chtml:pt))
2009-11-13 pix 22 (chtml:pt-name element))
2009-12-13 pix 23 (defmethod element-content ((element chtml:pt))
05:24:52 ' 24 (mapcar (lambda (node)
' 25 (cond
' 26 ((eq :pcdata (chtml:pt-name node))
' 27 (chtml:pt-attrs node))
' 28 (t node)))
' 29 (remove-if (curry #'eq :comment)
' 30 (chtml:pt-children element)
' 31 :key #'chtml:pt-name)))
' 32