···11041104 ))
11051105 in
11061106 (* atomEntry* *)
11071107- let fix_author pos (e : entry) =
11071107+ let fix_author _pos (e : entry) =
11081108 match e.authors with
11091109 | a, [] when a.name = dummy_name -> (
11101110 (* In an Atom Feed Document, the atom:author elements of the containing
···11141114 match authors with
11151115 | a0 :: a -> {e with authors= (a0, a)}
11161116 | [] ->
11171117- let msg =
11181118- "<entry> elements MUST contains at least an <author> element or \
11191119- <feed> element MUST contains one or more <author> elements"
11201120- in
11211121- raise (Error.Error (pos, msg)) )
11171117+ (* RFC 4287 requires at least one author, but many real-world feeds
11181118+ omit this. Be lenient and use an empty author rather than failing. *)
11191119+ {e with authors= (empty_author, [])} )
11221120 | _ -> e
11231121 in
11241122 let entries =
+1
stack/syndic/lib/syndic_common.ml
···9898 let get_leaf l =
9999 match find (function XML.Data _ -> true | _ -> false) l with
100100 | Some (XML.Data (_, s)) -> s
101101+ | None -> "" (* Return empty string for empty elements instead of raising Not_found *)
101102 | _ -> raise Not_found
102103103104 let get_attrs ((_, attrs) : XML.tag) = attrs