You know, I've also had this same question and Christophe had a very
similar response.

JSON is shockingly not supported by a very broad spectrum.

XML on the other hand is a very well supported data type, supported by
countless systems in a variety of APIs, DOM being the biggest.

Many times an ajax interface is integrated with a data model that
can't be changed, for instance an interface dealing with an RSS feed.

I believe at this point the core team needs to seriously consider some
form of support for CSS style selectors in an XML element.

http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/7ab88758e366a468/e01de1a0b6c739bf?lnk=gst&q=xml+css&rnum=1#e01de1a0b6c739bf
http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/b3be3f362f26cc99/818fdcacd4126e2b?lnk=st&q=&rnum=29#818fdcacd4126e2b

As a make shift hack for JGHSBC you can do this.  Granted I certainly
haven't thoroughly tested this but it worked for what I needed.

//myXHR is the transport object that is being received.



var myDiv = Element.extend(document.createElement("div"));

myDiv.innerHTML = myXHR.responseText;

var myCollection = myDiv.getElementsBySelector("rss item");


Cheers,
        Matt



On Sep 5, 11:02 am, Thomas Fuchs <[EMAIL PROTECTED]> wrote:
> Am 05.09.2007 um 16:44 schrieb JGHSBC:
>
> > Can the prototype library be used to query XML data stored within a
> > javascript variable?
>
> No.
>
> As an alternative, please look into storing data as JSON, as
> Prototype has support for that.
>
> best,
> thomas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to