开发者

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

I'm writing javascript code to traverse and manipulate deeply nes开发者_高级运维ted 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜