I continue to use Jedit for various tasks. It is okay for most of the tasks without the licensing headache. Today I decided to improve the RSS for Legacy Farm using XSLT. It was really nice that Jedit support both XSLT, XML, and HTMLTidy. I cannot say I started this mini-project with a firm objective. I just wanted to make the News page easier to keep current and I thought RSS should be able to do it. I was not interested in rebuilding the site using blogger software. I just wanted to modify one or two pages in the site. I prefer copy&paste over fancy and frequently buggy automation.
My choice of Jedit was partly out of curiosity. It said it had XSLT working so I decided to give it a try. I found a XSL stylesheet that should transform a RSS file into html. I ran into a variety of problems. The XSLT part barfed when I asked it to disable-output-escaping on the desciption section. The plugin was smart! It told me it was old and needed to be updated. It also told me that I needed to update my old verions of xerces/xalan. After some fiddling I got it to work. With a little more work on the xsl file, I got it to generate valid XHTML. Another annoyance was inputing dates. So I played with Beanshell macros until I created a macro that would insert the current date in the format I wanted. I created another macro to convert the html in the description into valid “escaped html” that RSS v2 likes and another that creat a new item in the RSS file.
So here is how it works right now. Its not pretty or efficient but it is interesting. A little tweaking will probably make it quite usable.
- Create news item web page in Dreamweaver. This just happens to be wyswing html editor I like. Any web editor should do.
- Copy the Html in the body over to a new buffer in jedit run Htmtidy on it to clean it up for xhtml. Copy&paste the cleaned up code back to Dreamweaver and into the description of a new item in the rss file.
- Update the pubdate field in both Dreamweaver and the RSS.
- Run the escape_html macro to fix the description field.
- Use XSL to create a new news summary web page from the RSS. Copy the html over to the news index page.
- We have now changed three files, rss.xml, news index, and the item news pages. We can use Dreamweaver to upload the files and your favorite validators to validate the html and rss.
- Fix the problems.