I have a problem, couldn't solve it for a long time.
I have the following XML file, returned from ajax:
?xml version=1.0 encoding=utf-8?
root
buildingsList
building
id1/id
addressVarvarka, 1/address
city_id1/city_id
/building
building
id2/id
addressNikolskaya, 1/address
city_id2/city_id
/building
building
id3/id
addressVarvarka, 3/address
city_id3/city_id
/building
/buildingsList
/root
And I wanna get the value of 'city_id' element of the each element
'building'.
I do the following:
$('/root/buildingsList/building', xml).each(function()
{
alert($(city_id, this).text(););
});
But it doesn't work as I expect. Am I wrong? I'm completely tired
looking for a mistake.
I've tried the following also, but it gave the same result:
$('building', xml).each(function()
{
alert($(city_id, this).text(););
});