Hello, I'm looking for a cross-browsers library based on prototype.js that wraps XML dom. I tried to extend XML dom elements by using Object.extend and Element.extend without success. It works fine with firefox (Object.extend) but don't work with IE (msxml). I suppose that IE objects are not 'prototype based' objects. Is there a way to go around this issue like prototype did it with HTML dom elements. I'm surprised notice that prototype do not provide such functionnalities because we are often led to deal with xml data with Ajax requests. I suspect that it's not easy or even not possible.... Thanks for your help
on 2008-06-20 10:29
on 2008-06-20 15:11
I was hoping for the same thing. I got tired of dancing up and down XML trees. It's a pain. I gave up and converted my data structures to JSON. It's much easier to deal with. My hair has even grown back since.
on 2008-06-20 16:55
That is correct; you cannot extend DOM prototypes in IE (what Object.extend() does). There is a project called Sarissa you might want to look at: http://dev.abiss.gr/sarissa/ > Sarissa is an ECMAScript library acting as a cross-browser wrapper for > native XML APIs. It offers various XML related goodies like Document > instantiation, XML loading from URLs or strings, XSLT transformations, XPath > queries etc and comes especially handy for people doing what is lately known > as "AJAX" development. > > Supported browsers are Mozilla - Firefox and family, Internet Explorer with > MSXML3.0 and up, Konqueror (KDE 3.3+ for sure), Safari and Opera. Konq and > Safari offer no XSLT/XPath scripting support AFAIK. > Somebody brought it into a project I was involved with last year. It seemed powerful but heavyweight. But if a full range of XML manipulation is what you need it might be the ticket. FYI, it has nothing to do with Prototype though. And hair retention is not guaranteed. ;-) -Fred On Fri, Jun 20, 2008 at 3:26 AM, fdb <frederic.dalbo@sage.fr> wrote: > Is there a way to go around this issue like prototype did it with HTML > dom elements. > I'm surprised notice that prototype do not provide such > functionnalities because we are often led to deal with xml data with > Ajax requests. I suspect that it's not easy or even not possible.... > > Thanks for your help -- Science answers questions; philosophy questions answers.
on 2008-06-20 22:03
This is something I've wanted as well, the core team has always just cried in the name of JSON. But it would be very convenient to have a nice proto extension to handle XML data. A lot of times the client side developer doesn't have a choice in the data services data format, which XML is still a very popular choice, there is still a very firm need for this. I think this is something I'll look into, i had come up with a very hacky workaround that just stuffed the responseText into a dom object, worked fine for FF as it handles "custom" html tags, but there needs to be better support. http://groups.google.com/group/rubyonrails-spinoff... http://groups.google.com/group/rubyonrails-spinoff... http://groups.google.com/group/rubyonrails-spinoff... -- Matt Foster Ajax Engineer Nth Penguin, LLC http://www.nthpenguin.com
on 2008-06-20 22:47
While prototype.js happens to be more JSON oriented, no one is really stopping community from developing an add-on extension : ) I think it's clear that solid XML-manipulation is never going to the core (unless prototype ever decides to become modular - and even then it's not clear who will be maintaining it) I'm not sure why there are no such add-ons around, but you are always welcome to submit one to scripteka. - kangax
on 2008-06-21 22:56
All the Ajax stuff in Netflix.com is XML-based, AFAIK. I think this would be a nice extension also. If you've already done some thinking about how this might look in terms of an API and feature set, I'd be happy to take a look and help out. -Fred On Fri, Jun 20, 2008 at 3:02 PM, Matt Foster <mattfoster01@gmail.com> wrote: > > This is something I've wanted as well, the core team has always just > cried in the name of JSON. But it would be very convenient to have a > nice proto extension to handle XML data. > A lot of times the client side developer doesn't have a choice in the > data services data format, which XML is still a very popular choice, > there is still a very firm need for this. I think this is something > I'll look into, i had come up with a very hacky workaround that just > stuffed the responseText into a dom object, worked fine for FF as it > handles "custom" html tags, but there needs to be better support. -- Science answers questions; philosophy questions answers.