#!/usr/bin/perl -w use strict; # # A script to convert slashdot headlines to VXML. # (C) 2001, Jaldhar Vyas # Licensed under the Crowley Public License ("Do what thou wilt # shall be the whole of the license.") # use LWP::Simple qw(get); use XML::LibXML; use XML::LibXSLT; my $content = get('http://slashdot.org/slashdot.rdf'); unless (defined ($content)) # undef means something went wrong. { $content = <<'-EOT-'; Failed to retrieve headlines -EOT- } my $xml = XML::LibXML->new(); my $xslt = XML::LibXSLT->new()->parse_stylesheet($xml->parse_fh(*DATA)); print "Content-type: text/xml\n\n" , $xslt->output_string($xslt->transform($xml->parse_string($content))); __DATA__
.