Recently, I discovered the java.awt.Desktop class (added in Java6) and it’s really helpful to trigger various operating system tasks such as opening a website, a PDF or even opens a file for editing in the operating system’s default editor.
In this post I’ve compiled a few ways to demonstrate the usefulness of the class and hopefully something that’ll help you to achieve something easily too.
One of the many podcasts I listen to on my daily commute is the Thrasher’s Wheat Radio Hour which offers a little insight into the huge and varied catalog of Neil Young.
I’ve been a fan for many years now and when I discovered this show I immediately wanted to subscribe to the podcast feed in my favourite “podcatcher” Miro. But this was to no avail … I could not find the feed link! The most recent show is merely added to an existing blog post as an update on the original page: http://neilyoungnews.thrasherswheat.org/2012/08/podcast-thrashers-wheat-radio-hour-show.html.
This wouldn’t do, so I decided I could roll my own feed of the show.
In Part 1 of this Testing XSL series I introduced how XSL can be used and some basic ways to test their correctness.
In this post I’m going to go into further detail with some utility methods that greatly reduce the amount of code you need to test the XSL on a more fine-grained level. They also abstract away any need to worry about DocumentBuilderFactories or Transformers and let you deal with just strings.
I refer to all XML manipulations via XSL stylesheets as simply “XSL”. One could get quite particular about calling something XSLT over XSL but really I just associate all things that read/manipulate/produce XML data with XSLT and XPATH as being XSL.