XSL is really neat
I'm trying to conceive of a good reason to output all of the data from my web applications as XML from now on, but really I can't think of anything practical.
I bet there's probably something I could do with it, though.
I bet it'd make AJAX-ifying a site easier.
September 1st, 2006 9:56am
I guess one shouldn't mention nsIXSLTProcessor.
September 1st, 2006 10:04am
I don't know what that is except that it seems to be a library for parsing and applying XSLT.
September 1st, 2006 10:06am
There was a huge push for a short while to modernize web apps to emit XML all the way to the client, where XSL would be applied for presentation. This was supposed to be the new way that the web would be built, completely separating content from presentation.
I actually did that once - made an inhouse timesheet app that would feed an XML data-island of the current month's time to the client, where it would be processed against an XSLT and populate a DIV. When they did changes (adding hours, changing descriptions, etc), it would do a side-channel "AJAX"y call, and on getting a 200 OK it'd apply the data directly in the client XML, then retransform it.
Incredibly simple, but it's the favourite app I've ever built. Way before its time.
September 1st, 2006 10:27am
Yeah, I'm thinking that this may be the way to go for the app I'm working on now.
September 1st, 2006 10:28am
I did that with my home-grown delicious app. It was almost two years ago now. So I forget wtf I did to get it to work. All I remember is seeing the XML come through and then I think I used C#/datagrid to apply the xsl to the xml.
nsIXSLTProcessor is Firefox's (or XPCOM's) component for transforming XML using xslt processing.
*WARNING*. It doesn't seem to be the newest version of libxstl and support every last XSL spec though (for any version of FFx), as there's sometimes a WTFs if you do non-Firefox unit testing.
September 1st, 2006 10:59am
September 1st, 2006 11:05am
WAIT A MINUTE...
Wasn't muppet the one who was like, "What's all the this stupid fuss about XML/XSLT to make HTML. Isn't that making things overly complex?" If it was you, then in some ways you were right. XML*XSLT=HTML is very cool, but there's a reason that it didn't take over during the push that Dennis describes.
That being said, my homegrown CMS we use at Sutter County (http://www.suttercounty.org
) uses it extensively.
September 1st, 2006 11:08am
Oh and I don't do the graphics for that site, I just write the code.
But it's a good site with a LOT of content and it's performant and easy to maintain and I'm gonna miss it...
September 1st, 2006 11:09am
"and I'm gonna miss it..."
What's up, Jeff? You moving on to greener pastures?
I've used xslt from inside my app to generate the HTML that was sent to the client. It was a great way to separate presentation and logic. I still like my libtemplate better, but libtemplate isn't exactly a standard.
John: Yep, I'm going to work for a dog food company. Really.
September 1st, 2006 11:29am
Well, congrats! Kinda gives new meaning to the phrase "eat your own dog food"... no, wait, it doesn't. That makes no sense. Oh well. Hope your new job kicks ass, though!