On Sep 6, 1:31 am, Matt Foster <[EMAIL PROTECTED]> wrote:
[...]
> 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 think you mean a language that can't be changed.
> I believe at this point the core team needs to seriously consider some
> form of support for CSS style selectors in an XML element.
Consider using XPath - it is likely that if a browser understands XML
it will probaby understand XPath too. But count IE out - it has no
idea about either.
> 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");
I don't think you can depend on innerHTML being able to generate a
useful document fragment if the markup really is XML, in any browser.
It is defined as being a property of an HTML element and is a
proprietary property of a browser that doesn't know what XML is.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---