view tests/mr.ur @ 11:43c3fbd8527a

Add variant of children allowing specification of optional matches.
author Karn Kallio <kkallio@eka>
date Thu, 23 Jun 2011 23:40:29 -0430
parents a4e5d053daed
children 0140b1662994
line wrap: on
line source
fun main () =
    doc <- Feed.fetch "http://marginalrevolution.com/feed";

    Feed.app (Feed.children
                  (Feed.tagA "item" ())
                  (Feed.tagC "link", Feed.tagC "title", Feed.tagC "content:encoded"))
             (fn ((), (link, title, content)) =>
                 debug ("URL: " ^ link);
                 debug ("Title: " ^ title);
                 debug ("Content: " ^ content))
             doc;
    return <xml>
      See stdout.
    </xml>