My weekend with XSLT
Note: This post is over a year old. You may want to check later in this blog to see if there is new information.
The following links are auto-generated but may help you locate newer content:
I just spent a very long weekend teaching myself XSL. I don’t mean long as in more than two days, but long in that I didn’t sleep and played with this stuff for hours straight. Days straight, actually. Too long. What I’m really trying to figure out is how to get this to apply to my current design. I can now fully see the power (and limitations) of xml and XSLT, but I don’t have a lot of applications that require such a technology. So here’s what I put together…
I wrote a HUGE ruby script that parses security logs. It can output all kinds of XML information for processing with different directives. I even used the ruby optparse library to make it pretty and user friendly. I’ll probably share it eventually, but for now it’s still under development. Most of its output is pretty “personal”, but I had fun with a setting called “—hackattack” that outputs only failed SSH attempts on my server. So here’s a page called “Who’s trying to hack Circle Six?”.
It uses simple xml output that looks like this:
hackreport.xml
[The requested file http://blog.circlesixdesign.com/wp-content/uploads/hackreportxml.txt could not be found]
The hackreport.xsl stylesheet then transforms it into an unordered list with a jquery accordian included. It was a little tricky getting the information to nest properly, but I got it figured out:
hackreport.xsl
[The requested file http://blog.circlesixdesign.com/wp-content/uploads/hackreportxsl.txt could not be found]
If you look closely, you’ll see that there’s a class attribute set on the headers based on how many hits came from the address. The CSS for the page determines that if there are more than 4 hits from one site, it displays with red type.
So that, in a nutshell, is where my weekend went. I did get the lawn mowed, and an air conditioner installed at The Urbane Animal. But ruby, xml and xslt have taken my free time away from me! If only I could make them useful… 
AJAX» CSS» design» ruby» scripting» server» ssh» web» xslt»
2 Comments
Jump to comment form | comments rss [?] | trackback uri [?]