Return NIL if attribute was not present
traversal/dom.lisp
Wed Feb 10 08:20:45 UTC 2010 pix@kepibu.org
* Return NIL if attribute was not present
--- old-Oh, Ducks!/traversal/dom.lisp 2015-04-10 05:31:49.000000000 +0000
+++ new-Oh, Ducks!/traversal/dom.lisp 2015-04-10 05:31:49.000000000 +0000
@@ -23,7 +23,8 @@
(defmethod element-attribute ((attribute symbol) (element dom:element))
(element-attribute (string-downcase (symbol-name attribute)) element))
(defmethod element-attribute ((attribute string) (element dom:element))
- (dom:get-attribute element attribute))
+ (when-let* ((attribute-node (dom:get-attribute-node element attribute)))
+ (dom:value attribute-node)))
(defmethod element-type ((element dom:element))
(dom:tag-name element))