Home

October 18th, 2005

09:39 pm
Because I get obsessive about stuff like this (UPDATED for IE)

So I have my recipes in XML, and use a web browser to transform them into a web-friendly form via XSLT. At the time I started working on this it seemed to me like I should be able to put all recipes in a single XML file, use XSLT to present a list of options, then allow the user to click on an option and view the recipe... all without reloading the page/xml whatever. It should be do-able with XSLT and XQuery.

I was chatting with Christoph today and mentioned this. Then, because I get obsessive about stuff like this, I figured out how to do it this evening--using Javascript, XSLT, and XQuery.

The current implementation only works with Firefox. An IE implementation would be similar (though it seems like IE does not support XQuery via document.evaluate, so I'd have to walk the doc tree and do an ID match).

Anyways, if any of you are interested (because I had to glean much of this from many, many, many different websites), you can see the end result here:

http://www.worcesterworld.com/drecipes/

Warning: My Javascript is yucky.

Update: Should work with IE now.