Return NIL if attribute was not present
Wed Feb 10 08:20:45 UTC 2010 pix@kepibu.org
* Return NIL if attribute was not present
diff -rN -u old-Oh, Ducks!/traversal/dom.lisp new-Oh, Ducks!/traversal/dom.lisp
--- old-Oh, Ducks!/traversal/dom.lisp 2013-07-21 15:11:13.000000000 +0000
+++ new-Oh, Ducks!/traversal/dom.lisp 2013-07-21 15:11:13.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))