Loader.doXPath not working in FireFox!PLEASE HELP!

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

It seems that xml is not correct… Hotel should be closed after RoomTypes:

The js code could be as follows ("./na:RoomTypes/na:RoomType"):

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/na:RoomType",hotels[i],"http://schemas.tourop.com/webservices/hotelv5");
     alert(roomtypes[0].getAttribute('name'));
}

Alexandra THANK YOU for your response that does work. Also I’m sorry if I sounded DESPERATE earlier.

You are right that the XML should have a closing Hotel node, but I was typing it by hand as the original XML is very large so I had to extract bits of it.

Thanks again

I’m glad that the problem is solved :wink:

@Alexandra, I am also having a similar problem, can I send you a pm? Or should that start another thread?

@Alexandra, I am also having a similar problem, can I send you a pm? Or should that start another thread?

yes, you should start the new thread