#!/usr/local/bin/xcerpt --cgi %+ DOC COMMENT BEGIN % The Slashdot site is a popular news site % among Open Source and Unix people, featuring technical articles relevant to % this audience. % This Xcerpt program reformats the information contained in the RSS summary % of the site. %+ DOC COMMENT END goal { cons { out { resource { "stdout:", "xml" }, html [ head [ title [ "Slashdot Headlines" ] ], body [ var Channel ] ] } }, query { var Channel -> div {{ attributes {{ id { "channel" } }} }} } } rule { cons { div [ attributes { id { "channel" } }, h1 [ "Channel:", var Channel ], table [ all [ tr [ td [ var Title ], td [ a [ attributes { href { var Link } }, var Link ] ] ] ] ] ] }, query { in { resource { "http://slashdot.org/slashdot.rss", "xml" }, RDF [[ channel [[ title [[ var Channel ]] ]], item [[ title [[ var Title ]], link [[ var Link ]] ]] ]] } } }