;;; dom.el --- XML/HTML (etc.) DOM manipulation and searching functions
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: xml, html
(cons dom matches)
matches)))
+(defun dom-strings (dom)
+ "Return elements in DOM that are strings."
+ (cl-loop for child in (dom-children dom)
+ if (stringp child)
+ collect child
+ else
+ append (dom-strings child)))
+
(defun dom-by-class (dom match)
"Return elements in DOM that have a class name that matches regexp MATCH."
(dom-elements dom 'class match))