2007.03.13

More insanity-inducing XML parsing. How difficult is it for people to understand XML and XSLT? It's not that complicated! You've got a few tools - you've got tree parsers, stream parsers and you've got XSLT. Read the very simple guides as to what they do and then use them for the appropriate thing. 2007-03-13T17:52:56ZUntitled entry permalink

Backwardsland 2007-03-13T09:28:18ZTitled entry permalink

Want to see someting utterly insane? How about backwards SAX-style XML parsing. Yes, that is insane. Surely, the simple answer is to use SAX to parse the whole document as a stream and use an attribute in the root child element to specify the piece of data you want, and then take that particular chunk and load that in to a tree parser like DOM.

There may be performance hacks that could merit this type of approach, but the idea of using this approach as a method to implement a key feature in an application is absurd and insane.

A neat hack I found recently with writing an XSLT-based microformats parsing system in PHP5 is to use regular expressions to search a document. Basically, I have an XSL stylesheet to convert, say, hCards in to RDF/XML. But there's no point in going through the process of spawning an XSLT processor or loading the stylesheet in to the DOM if there are no hCards in the document. A regular expression just looking for the word "vcard" rules out the vast majority of documents that don't contain hCards. It's just an eliminative process to increase performance and reduce server load.

It's not pure XML though. When XProc comes in to vogue, I'm not sure what we can replace such hacks with. Perhaps you could do it with XSL by using regular expressions to invoke external stylesheets. I'm betting that such a hack wouldn't be particularly efficient.

I like the idea that M. David Peterson puts in the comments of producing an XML Best Practices specification, although I'm pretty sure I wouldn't contribute to such a specification - my best practices are snark-filled and evil.

The only rule of XML Best Practice is "Actually goddamn use XML!" - a rule that our friends at both the W3C and the WhatWG ought to tattoo backwards on their forehead.

Comments | TrackBack

XHTML has been a failure! 2007-03-13T15:03:43ZTitled entry permalink

XHTML is being used by Wikipedia, Twitter, Wordpress.com, Blogger, digg, TechCrunch, Comment is Free, upcoming, Facebook, TypePad, LiveJournal, 43things, Grazr, 37signals, MeasureMap, TUAW, Gizmodo, Skype, Adobe, BBC Backstage, TheyWorkForYou, Mashable, Rocketboom, Ze Frank, Jeremy Keith, Zeldman, A List Apart. And that's just scratching the surface.

What a total failure. Let's go back and party like it's 1997 with unclosed tags and implied 'head' and 'body' elements. The next generation of browser development really needs to be based on tag soup! Woohoo! By the time we get to 2012, we'll have mobile browsers that are 200Mb in size! Yay for the future of the web!

Seriously, if you want to die young, follow the standards procedure. Crawling across a field of land mines is about as pleasurable as watching the tragedy on wheels that is the web standards process.

The future of the web is at the very least XML-based. Anything else is bullshit. Tag soup needs to die a quick death.

Comments | TrackBack

 

Login with your OpenID:
Le Web '08, Paris, December 9th and 10th, Register Now! 20% off.
No. 499
Tom Morris
Currently in: East Sussex, England
Usually in: East Sussex, United Kingdom
AIM: tommorris
YIM: tom.morris

I am a , an , like to code in and noodle about with and the . I also have a BA in philosophy from London, and am studying for an MA. My philosophical interests are in Victorian-era German philosophy, Kierkegaard, Robert Nozick, hermeneutics and current approaches to the demarcation problem in the philosophy of science. Musically, I like jazz fusion, soul and P-Funk. My musical nirvana would be a mixture of Beethoven, Miles Davis and George Clinton topped with a side-serving of Erykah, Jill and Angie.

I also write for the Citizendium, an online encyclopedia project. If you know about stuff, you should join in.

Elsewhere:

  • GPG Key
  • del.icio.us
  • Flickr
  • Twitter
  • digg
  • Jaiku
  • LinkedIn
  • ma.gnolia
  • blip.tv
  • upcoming.org
  • MetaFilter
  • LiveJournal
  • CiteULike
  • Technorati Profile

RSS Feed Subscribe:

RDF

« March 2007 »
SuMoTuWeThFrSa
 123
45678910
11121314151617
18192021222324
25262728293031

View in month context

On this day in: 2006