xml-stylesheet and the World of Warcraft home page
The day before we left Michigan, my best friend and Best Man presented me with a copy of World of Warcraft. He and his girlfriend have been playing the game for quite some time now, and it's how they keep in touch with a few family members - and now, it looks like it'll be a way that they can keep in touch with me. I can only hope that I don't get too sucked into the game. :)
All of that aside, though, I just noticed something as I was making an initial pass at registering for a WoW account: At the moment, the World of Warcraft front page is broken.
It'll probably be fixed by the time you see it, but since my first impulse upon seeing an error is to "View Source", I noticed something further: Their front page is XML, with an XSL processing instruction at the top. I'm not sure if this is the way it has been for some time now, but I have to admit I never expected to see this trick used on a production website. Turns out the page is broken because the XML document is unexpectedly truncated in a run of JS code, and so Firefox throws up the old "XML Parsing Error" page.
Now, the reason I never expected to see it on a production site is because I didn't think enough browsers supported the xml-stylesheet
processing instruction. And then, of course, there's the issue of serving up parsing errors from your front page when strict parsers refuse to humor your sudden tag soup.
But, I do have to say that I've harbored a wish to use xml-stylesheet
on real sites for quite some time now. A lot of the things done with a server-side content management system could be pushed off to the client - things like headers and footers and sidebar assembly and includes. And it just feels nice to make the client do some of the work for you, taking some weight off the poor abused servers.
On the other hand, I sure do wish that the WoW front page wasn't broken right now.
Archived Comments
If you go to http://www.worldofwarcraft.com/index.xml it works.
And yea, they made that change just last month. I've seen the parsing errors like that at least three times since then. All of them have had to do with the non-"www" hostname. I wonder why?
Wow, that's really interesting - I wonder if they serve things up based upon the user agent that's used. If not, I wonder how they deal with search engine indexing.
It’s a fine idea, as long as you remember that the untransformed markup must be able to pass for HTML that is navigable as is, lest you shut out search engines, speech browsers etc.
If I made use of this, I’d serve up actual XHTML and use the stylesheet only to insert repetitious bits of markup. Now that I think about that, it might in fact be a sweet way to inject the extra non-semantic markup required by the easy techniques for rounded corners or sliding doors, without actually touching the document. Oh, oh! Zebra tables! Hmmmm, now I’m thinking.
Gotta investigate.
Aristotle: Of course, if you use it that way, you might as well throw in some unobtrusive JS to wrangle the DOM into desired shape. I wonder which is more efficient to run, and which would be smoother to write? JS and DOM scripting leads to all sorts of uncomfortable loops that make me wish for XSL's XPath matches...
I suspect that WoW's audience consists of earlier-than-average adopters, so they can expect the latest browser versions. The only way to know whether or not you can pull it off (from a business perspective) is by looking at your user agent headers in your logs.
That said, I am in love with the idea of replacing most of my DOM scripting with XSL.
Hi Leslie,
This has been an area of keen interest, and in particular, specialized research and development[1], for over three years now. Opera was the last of the major browser vendors to add XSLT support -- while there are still a few broken areas[2, 3], things are getting better. In short, IE 5.x+, Mozilla, and Safari ALL support XSLT 1.0, with Opera only a few functions short of full support.
Theres a lot that can be done in this area, and dependent on a few factors that may boost its arrival, expect to see a TON more in this area from my direction in regards to OSS software projects released that build and extend from this in a BIG way.
[1] http://www.xsltblog.com/archives/2005/12/finallysomeone1.html [2] http://www.oreillynet.com/xml/blog/2006/06/opera90finalreleased.html [3] http://www.oreillynet.com/xml/blog/2006/07/nosignofdocumentfunctionb.html
The change was recent. I think there are some posts around about the change. Before it was a table-based tag soup that took forever to load. It still is some soup but it looks much lighter then it did back then. They most likely did the change to save on bandwidth and/or make things easier to change. I postponed my account awhile back though.
They don't seem to advertise it but they now appear to finally have RSS for the news:
www.worldofwarcraft.com/rss.xml
Yeah, but DOM scripting sucks so bad. :( I like Javascript, but I hate DOM scripting. (My kingdom for widespread adoption of E4X.)
We do it because there’s no other way. But I really want a better way…
We do it because there’s no other way. But I really want a better way… <<
Amen to that!
I'm really confused as to why they have gone with this particular implementation, from the standpoint of separating content from design, using XML as the data layer and XSL as the display layer is completely beautiful. But if you really look closely at the source of WOW's homepage, they actually have a lot of the content served up INSIDE THE XSL. The XSL sheets are specific to each page, and it drives me insane trying to understand the logic behind doing this.
If you have any insight into it, please, drop me a line, because I'm at a loss.