loader.doXpath not sending namespace information

I have the following statement :

		var hotels = loader.doXPath("//Hotel",null,"http://schemas.tourop.com/webservices/hotelv5")

However if I step through with Firebug the following function in dhtmlxcommon.js is showing nothing for namespace. Not null or an empty string just nothing i.e. if I put my cursor on ‘namespace’ nothing is shown but if I put on xpathExp then I can see ‘//Hotel’ in tooltip and ‘null’ if I put on docObj and ‘undefined’ on result_type but nothing shows when I put on namespace.

dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type

Please can you tell me what I’m doing wrong because my xpath queries do not work.



please provide sample to recreate the problem ( use static xml in the demo).

Alexandra I don’t know how to load static XML into loader but the try the following xml.

If you load the above into a ‘loader’ object and then do

 var hotels = loader.doXPath("//Hotel",null,"http://schemas.tourop.com/webservices/hotelv5")

You should get 2 items in hotels. I get nothing.

Thanks for your help.

You may try the following:

hotels = loader.doXPath("//Hotel");
hotels = loader.doXPath("//na:Hotel",null,“http://schemas.tourop.com/webservices/hotelv5”);

Thanks Alexandra that works. However if I had some XML which had a common node name but with different namespace how would I deal with that for IE?

Also for non IE where does the ‘na’ in doXPath("//na:Hotel" etc come from?

Finally if we extend the example XML as follows:

what is the doXPath syntax to get at the RoomType nodes whilst I am iterating through the Hotel nodes?

I tried:

  roomtypes = doXPath("./RoomTypes/RoomType",hotel[i]),namespace info)

But that appeared to hang.

Thanks for your help.