The value of old code

I am currently digging into CSS, and decided that a good little project would be to take XML files, transform them into HTML using XSLT and apply a CSS to the result to get ‘shiny’ web page.

My starting point was a pretty basic CSS file for RSS feeds which I found on the net, it did come with an XSLT file as well of course, and I had fun ripping both of those up and turning want was a pretty drab result into something a little nicer. I have to admit that I like the transform Safari applies to RSS/ATOM feeds and decided to go for that look.

Parenthetically I discovered two things about the Apple CSS. One is that it uses styles internal to Safari, for example:

display: -khtml-box;
-khtml-box-orient: horizontal;
-khtml-box-align: baseline;

I have to admit that I don’t like this at all, but whatever. The other is that is uses virtually no HTML markup preferring to control styles through divs and spans which was interesting. I had originally started off using some amount of HTML in my XSLT output but decided to ditch it all in favor of divs and spans, which gives some additional flexibility I think.

Back to the value of old code, I have worked with XSLT before in the past, about 4 years ago, and went back to that work (about 9,000 lines of code) to quickly get back up to speed with it. I generally don’t throw away code, especially code that had to be done in a specific language or for a very specific need because you never know when it might come into useful, either to ‘steal’ from or to quickly get back up to speed with it.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: