Pages

Saturday, November 17, 2007

Working with XSLT

The project I’m supposed to be working on is going to have a large focus on XSLT. So a while ago I looked into it and had a play around.
Then did some XSLT related to the project. All was good.

But you never really learn anything unless you use it for your own requirements. So I thought: “html should be valid xml. I should be able to apply XSLT to a html page and get some values out of it”. The wiki we use at work supports an xslt tag and the page I was going to target was bash.orgs latest page. On my first few attempts, I only got errors.
So I simplified it to use a working example (just to make sure that the XSLT engine was working in the wiki); all was good.
I changed the XSLT to be as simple as possible. still good.
I then changed the source back to bash.org and it failed. Turns out that the site is invalid. Pitty.
I have a feeling that the web will change and become quite interesting when everyone adheres to well formed html.

Anyway, to the interesting point.
At one point, I was parsing an XSLT document as the source of information (since XSLT is well formed XML anyway).
It got me thinking. Could you ever write an XSLT transformer with XSLT? (probably not)
But the funny thing I thought of, the first bug tracking system. If it was done in an agile fashion, version 0.0.1 would only support creating bugs, and the bug list would look something like
* Cannot edit bugs
* Cannot resolve bugs
* Cannot assign bugs to person
* Cannot tell who created bugs
* Cannot distinguish between bug and feature request
ah, distractions. Probably should get back to work.

-= Comments
1. Mark | November 16th, 2007 at 11:03 am
“html should be valid xml. I should be able to apply XSLT to a html page and get some values out of it”
Valid XHTML is XML and you can apply transformations, but HTML isn’t well formed.

“I have a feeling that the web will change and become quite interesting when everyone adheres to well formed html.”
I don’t think we’re going to get there any time soon, when XHTML is actually supported in browsers I forsee a big shift in the way markup is generated and used, XHTML must be valid or it just dies. So people won’t be typing long strings of XHTML by hand but rather parse it with other proccesses that ensure valid, well structured markup.

It’s hard too see where we’ll end up though, while Web Standards is gaining ground - so are frameworks where the bottom line is productivity, and web standards isn’t on their prioirty list. I think we’re going to lose of people to the Flex, good luck parsing that! ASP.NET encourages you not to work with / think about the generated markup, the controls are that abstracted. This is another reason I’m really enjoying Rails at the moment, it generates clean markup, and it encourages best practice in the front-end coding.

But you can still use DOM to walk the tree of a document, even if it isn’t completely valid. Thinking about it you should be able to request a page with HttpRequest and then traverse that with DOM..maybe

xhr.open(’GET’, ‘http://www.bash.org/?latest’, false);
… do things..
var content = document.createElement(’div’);
content.innerHTML = xhr.responseText;

// Get all links In page
var linksInBashLatest = content.getElementsByTagName(’a');

It’s not as efficient or as nice as XSL but if you need to get parts of the document you should be able to it with javascript..perhaps

Wednesday, November 7, 2007

How not to start a long weekend


Low life, pathetic scum.
I think it was done at the Bayswater car park, but I didn’t actually notice when I got in the car to drive it home.

Gaa

-= Comments
1. Mark | November 8th, 2007 at 10:00 am
VINCENT
You know what some fucker did to it the other day?

LANCE
What?

VINCENT
Fuckin’ keyed it.

LANCE
Oh man, that’s fucked up.

VINCENT
Tell me about it. I had the goddamn thing in storage three years. It’s out five fuckin’ days — five days, and some dickless piece of shit fucks with it.

LANCE
They should be fuckin’ killed. No trial, no jury, straight to execution.

VINCENT
I just wish I caught ‘em doin’ it, ya know? Oh man, I’d give anything to catch ‘em doin’ it. It’a been worth his doin’ it, if I coulda just caught ‘em, you know what I mean?

LANCE
It’s chicken shit. You don’t fuck another man’s vehicle.

From hyro to ....

I’ve put this off for a while but it is worth noting now.
Lucien picked up that I added an end date on my employment history on the wiki. Now I get to say why.

I originally join HotMagna, a small agile company that focused on simple Java solutions to technical issues. About the time I joined they were bought out by hyro. Like any joining, there was a little turbulence whilst the company worked itself out and I was happy to sit through it and assist in its transformation. hyros focus has been more on creative solutions and assisting companies in advertising their services.
For the past year or so, hyro has gone from an interest to buying Synergy, acquiring Synergy and starting to integrating their business into the hyro “family”. This is where things started to get hard for me. We now had 3 companies that approach different problems and internally, solved problems in very different ways. Whilst I have no doubt that once the company as a whole works out its direction, it will be an interesting company and place to work; it has got in the way of me coding.
And there focus is definitely on me.

I want to code. I miss the days of Uni where I would wake up early Saturday and code through day and some of the night until I needed to sleep. I can’t do that in a standard business because budget is always going to get in the way.

Many have pondered what I will be doing after I leave. The most direct answer I can give is sleeping in. After that, I’m not sure.
There are a couple of options that I have available:

  • A couple of friends have caught wind of my intentions, and would be happy to work with me (more development).

  • My brother is always looking for more people to join him as an air conditioner architect.

  • I’m tempted to find out how hard it is to make money out of google ads on a website.

  • I could also chase the dream of building entry level websites for small business owners.


I’m probably not going to look for anything in December since most people will be gearing down for Christmas. I am going on holiday with the family in January so I won’t be looking for a job then either.

If I come up with anything else that might be relevant, I’ll let you know.

-= Comments
1. Andrew B Coathup | November 6th, 2007 at 11:45 pm
Leaving your first job is very hard.

Leaving and not having anything lined up is a big step.

Enjoy the summer break. There are companies out there where you can just code. If I had more time in my day then I could do that where I am. Don’t give up the coding.

I know people who have lived the dream and set up there own companies. There is still lots of money (and fun) to be had doing applications for very niche markets. The VB boys did that for all of the 90’s.

Good luck. You have made a big step.

I did the same 2 and a 1/2 years in to my first job and went travelling.

2. Xavier | November 7th, 2007 at 1:20 pm
Nice one. It really annoys me when people complain about their jobs but won’t quit.

Steve Pavlina has some really good articles on making money out of a blog (and life in general), which I’d highly recommend.

Also, come along to the melbourne ruby meetup next thursday. Always companies looking for good people, plus it’s a good crowd to have a drink with. And it’s ruby! Also, I am doing a presentation