Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Filtering atom feeds by title

2006, atom, xml

I've just announced a number of new feeds, and the way that I did it was to set up an XSLT filter that scanned the titles of my blog entries, using the [XML] notation that I've been putting at the front of each of my articles for just this occasion. Fortunately, the XSLT wasn't that difficult to put together; if you want to use it yourself, you're more than welcome to download the atomFilter.xsl file and use it yourself (under the EPL).

Here's how I use it:

xsltproc --stringparam filter XML atomFilter.xsl All.atom > XML.atom

Of course, if you use a different XSL tool than xsltproc then simply adjust the parameters for passing the 'filter' value in. Bear in mind that it's expecting to be a string, so needs to be quoted properly; for example:

java org.apache.xalan.xslt.Process -IN All.atom -XSL atomFilter.xsl -OUT XML.atom -PARAM filter "'XML'"

Note that the XPath expression needs to be in single quotes; your shell will probably require you to quote that value in double quotes.