Xml and xpath
Xml and xpath
I am trying to load an xml, and then to query it using xpath.
i've tried this:
$.ajax({
type: "GET",
url: "Menu.xml",
dataType: "xml",
success:
function(xml)
{
$(xml).find('/Root/Item').each(...);
}
}
It didnt work, i've also tried this:
$('/Root/Item',xml); and it also didn't work.
How can i query only for item nodes that are under root?
I know that i can do this: $(xml).find('item'); - But this returns me all item nodes regradless if it is the first child of root or not.
PLz help me