I have the following XML which I have got in ‘loader’ after an Ajax asynch ‘Get’:
I also have the following code:
if(_isIE)
{
hotels = loader.doXPath("//Hotel");
}
else
{
hotels = loader.doXPath("//na:Hotel",null,"http://schemas.tourop.com/webservices/hotelv5");
}
for(var i=0; i<hotels.length; i++)
{
alert(hotels[i].getAttribute('category'));
if(_isIE)
{
roomtypes = loader.doXPath("./RoomTypes/RoomType",hotels[i]);
}
else
{
roomtypes = loader.doXPath("./na:RoomTypes/RoomType",hotels[i],"http://schemas.tourop.com/webservices/hotelv5");
}
alert(roomtypes[0].getAttribute('name'));
This works fine in IE8 but I don’t get the ‘roomtype’ ‘name’ showing in the second alert for FireFox. I haven’t tried it on other browsers but I think the problem will be there.
Please can you tell me what I’m doing wrong?
Thanks