X-Git-Url: http://git.kpe.io/?p=cl-rss.git;a=blobdiff_plain;f=main.lisp;h=3545f936393e1cdfdde049dbf71888188e50e976;hp=44fd7885797981e5662e23deb6077cfd9bc908c2;hb=e1c6775076354b532edccd95b8c3ad03b7a60bea;hpb=89e8113d1073d66460c11c6e5667f575b6e1ce52 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 <link>, 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)