2.2. Example: parsing a file with paperboy

Let's jump right in and do a normal operation with paperboy: download a file, apply a template, and output it to a file. For this example, you will need an RSS feed you want to download, and an XSLT stylesheet you want to apply to that feed. I will be downloading http://collab.freegeek.org/~wren/rss/blog.rss and applying wren's tutorial1.xsl template. The -f option specifies where the downloaded XML will be stored, the -u option is the URL, the -t option is the path to the XSLT template, and the -o option is where to output the parsed feed.


kryptech@debian:~/xml$ paperboy -f blogentries.xml -u http://collab.freegeek.org/~wren/rss/blog.rss 
-t tutorial1.xsl -o blogentries.html
			

paperboy should be silent and return momentarily. After the program ends you should be able to see the contents of what you downloaded in blogentries.xml. The output (parsed feed) should be in blogentries.html.

2.2.1. Download flags

There are two flags that control downloads, -g and -G. -g will only download the feeds and ignore any templates it was passed. -G will only apply templates and not download the feeds. These two options may seem strange at first ("if I didn't want to download anything I wouldn't have put any -u flags in there!"), but they're intended to be used with paperboyd rather than directly. Rather than explain why they're useful here, they will be discussed when paperboyd is discussed.