Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the situation with XSLT and XPATH in modern browsers?

I'm writing javascript code to traverse and manipulate deeply nested XML documents. With modern browsers, is there still a need for crossbrowser libraries like:

  • sarissa
  • ajaxslt

As far as I know, without using one of these there won't be any XPath in IE with ActiveX disabled. And a simple wrapper is needed for both XSLT and XPath to distinguish between IE and w3c XML Dom.

like image 314
ko-dos Avatar asked Feb 16 '10 19:02

ko-dos


Video Answer


2 Answers

As long as you stick to XSLT 1.0 functionality, I would say that XSL and XPATH support work reasonably well on all browsers, even as far back as IE6.

That being said, there's enough annoyances in client-side XSLT processing (including until recently a fiendish JQuery bug in firefox for files generated with client-side XSLT) to make it not worth your time.

I worked hard on this topic during most of 2009, and I just can't see any good reason to do the processing on the client, when it's just as easy to do it on the server. If you have to offer XML, allow the client to specifically request it with a query-string variable or an Accept: header.

like image 189
Jonathan Hanson Avatar answered Oct 01 '22 14:10

Jonathan Hanson


The situation is bad and not improving very quickly. Add Chrome to your list. Process the XML server side if you can, SimpleXML in PHP5 and the Xml control in ASP.NET are great places to begin.

like image 28
mmcglynn Avatar answered Oct 01 '22 15:10

mmcglynn