News for hackers. Stuff that matters.
Re:XML: Contrary to popular belief, it doesn't always kill b... by nivertech on Saturday February 19, 2011 @09:28PM (#2240754)
What in jQuery is a chain of multiple selectors and filters, can be done using single query in XPath, i.e.

  "document()/html//div[class='title']//img[class='icon']/@src"
Re:XML: Contrary to popular belief, it doesn't always kill b... by Groxx on Saturday February 19, 2011 @09:38PM (#2240775)
I gather you haven't done much jQuery coding. That's equivalent to:

  $("html div.title img.icon").attr("src")
The last .attr("src") is purely because jQuery always deals with a node / a collection of nodes.

You can also do arbitrary attribute searches:

  $("html div[class~='title'] img[src*='google']")
  // "~=" == "contains word" - space-delimited to match html classes
  // "*=" == "contains substring"
http://api.jquery.com/category/selectors/
Re:XML: Contrary to popular belief, it doesn't always kill b... by nailer on Sunday February 20, 2011 @04:14AM (#2241483)
You're right, but jquery doesn't handle XML namespaces. Alas I wish it did.