Home :: Feed.Us Blog :: XSL and CSS
Here's some background on XSL - one of the main ingredients of Feed.Us:
XSL is Extensible Stylesheet Language. It formats or transfers XML (the data) for, or into, a layout. XSL is a template language developed by the W3C and is recognized in all the big browsers. You can actually attach an XSL file to an XML document much like you'd apply a CSS file to an xHTML document. Your XSL dictates what fields get displayed out of the XML and how it displays. (BTW, XSLT is Extensible Stylesheet Language Transformations - the language of XSL.)
Most big web companies, like Six Apart, Facebook, Automattic etc write their own markup language rather than use the widely accepted XSL. That's why you probably had to learn something new if you created a MT, WP, Typepad blog or if you're working on a Facebook app. But XSL is more convenient - there are tons of documents and existing files floating around the internet. The W3C tutorial is a great place to start to learn more about XSL.
XSL has a received a mixed reaction from developers, from issues about competition with CSS, to performance. After lots of research, it's seems there are pros and cons as with any technology. We've seen the benefits outweigh the ills. It also appears that XSL 2.0 proves to address many of the concerns with XSL 1.0. We're looking forward to that and will implment it as soon as it's available.
The most tangible concern is that of performance, but with Feed.Us we're caching the XSL results to a local file on your server. So it performs remarkably fast.
XSL works great with CSS.
XSL was created to transform XML, and with a little knowledge it works wonderfully with CSS. You can easily apply whatever div tags and classes you choose within your XSL file in order to make the data (the XML) work in conjunction with your CSS. See the graphic on the right - it's from an XSL we're using to display this article.
XSL dovetails really well with XHTML and CSS because they are both W3C technologies, made to fit together. The proper use XSL and XML can make your CSS work a lot easier. You can standardize your div structure and just change the CSS.
Why we use XSL with Feed.Us
Well, first of all your content (your data) comes out of our server to your website as XML. So it's a natural that we'd use XSL. But the big reason is that we try to not push anything new or unconventional on our customers. We want to re-use technologies that are accepted and well-known. Everything you need to know about XSL can be quickly found at a bookstore or on a tutorial site.
Plus, XSL is a natural progression for folks who started with HTML and picked up CSS. Like CSS/xHTML and HTML, it's very readable. You might not be able to code it straight up, but you can easily read through it and make modifications and there are so many XSLT users out there you can find answers to almost any questions you might have.
For example, a common use for XSL is to transform an XML source into multiple output formats (i.e. HTML, WML, even other XML and it's derivatives like RSS, ATOM, etc). So by simply checking the source of your web request you can respond with a properly formatted document, and since it's all cached, it happens lightning fast. We provide the starting templates for you and you can customize them as needed.
XSL is conveniently platform independent. The XSL documents you use with Feed.Us can come from outside sources and can be used outside of Feed.Us. If you choose to leave Feed.Us, you can take your XSLs with you and continue to use them with your CSS layouts on some other service.
More importantly, you can get XSL files from other sources and apply them within Feed.Us. We recently found a really nice "box style" monthly calendar XSL file via a search in Google. We're using it to display a bunch of upcoming events. It's a lot like the free CSS templates that are readily available via a Google search.
blog comments powered by Disqus