xml - How can I use JQuery to get all nodes with an attributes equal to a value? -


I get some XML return from AJAX calls (no wonder) and I want to do something but only on some nodes And for some more example on the other

  & lt; Xml & gt; & Lt; Node name = "x" & gt; & Lt; / Node & gt; & Lt; Node name = "x" & gt; & Lt; / Node & gt; & Lt; Node name = "y" & gt; & Lt; / Node & gt; & Lt; Node name = "z" & gt; & Lt; / Node & gt; & Lt; / XML & gt;  

I want to name all the nodes to go to a table and I want all the others to go to another table.

  $ ("node [name = 'x']"); = "Post-text" itemprop = "text"> 

Use the attribute filter;

To select all other nodes, use it:

  $ ("node [name! = 'X']");  

You can apply jQuery to move these nodes elsewhere.

Note that XPath-style selectors have been deprecated in version 1.2, and have been completely removed in jQuery 1.3.

If you send the server, you want to spy on it, you would like to use JSON instead, you can easily get it parsed.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -