X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=main.lisp;h=3545f936393e1cdfdde049dbf71888188e50e976;hb=HEAD;hp=44fd7885797981e5662e23deb6077cfd9bc908c2;hpb=dc76abe52ed6323608c8d01616a64b0204498c5e;p=cl-rss.git
diff --git a/main.lisp b/main.lisp
index 44fd788..3545f93 100644
--- a/main.lisp
+++ b/main.lisp
@@ -111,11 +111,14 @@ was already set."
throwing an error if it was already set, or if they aren't a string. Used for
elements like
and , which shouldn't crop up twice."
(let ((string (car (xmls:xmlrep-children node))))
- (unless (stringp string)
- (error 'rss-parse-error
- :msg (format nil "Got ~A when expecting string for contents of <~A>"
- string name)))
- (setf-unique-slot object name string)))
+ ;; skip empty nodes
+ (when string
+ (progn
+ (unless (stringp string)
+ (error 'rss-parse-error
+ :msg (format nil "Got ~A when expecting string for contents of <~A>"
+ string name)))
+ (setf-unique-slot object name string)))))
(defun ensure-string-slots-filled (object required-slots strict?)
"For each slot in REQUIRED-SLOTS, if it is unbound in OBJECT, set it to the
@@ -157,6 +160,9 @@ and BODY is performed with ITEM set to the item we're modifying and NODE set to
the XML node we just got."
`(defun ,name (node object strict?)
(declare (ignorable strict?))
+ ;; skip atom-related tags
+ (when (equalp "http://www.w3.org/2005/Atom" (xmls:node-ns node))
+ (return-from ,name nil))
(string=-case (xmls:xmlrep-tag node)
(,@(mapcar
(lambda (sym) `(,(symbol-to-name sym)