blob: 33c90a215df52a0afd3263bed01ec4cff61b57d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
(* Unavoidable module for functions that don't fit anywhere else *)
let find_xml_child name xml =
let find_aux e =
match e with
| Xml.Element (name', _, _) when name' = name -> true
| _ -> false
in
match xml with
| Xml.Element (_, _, children) -> List.find find_aux children
| Xml.PCData _ -> raise Not_found
|