XPath in Safari

One of the reasons I've been slack in my DHTML and JavaScript development is due to one browser: Safari. In case you missed my little mini-rants, I don't like the browser. It has horrible JavaScript error reporting and the feature set is lacking in many areas; the two most prevalent being no real way to load XML into a document (except with XMLHttpRequest) and no XPath support.

On the other hand, Safari is the browser of choice for most OS X users. Completely ignoring the browser isn't the smartest thing to do (especially now that I can't use the "I don't have a Mac" defense); I could get away with Opera because the market share is so small, but there's no real alternative to Safari on OS X, or so I've been told. Lately, I was thinking I'd bite the bullet and parse XML documents the old way: loop through every node, check its name and type, and use the data if needed. But not anymore =)

Yesterday, I discovered that WebKit, the engine that drives Safari, now implements both XPathEvaluator and XSLTProcessor. Sweet! I'm not sure, however, when it'll be added to the actual Safari browser, but at least I can push forth on my scripts that require XPath without feeling guilty. Now all I need is Document.load() (or DOM 3 Load/Save) and getters and setters, and I'll be happy.

8/5/2006 12:00:00 AM | Tags: Safari, Webkit, XML, XPath
© 2008 Jeremy McPeak