xml - IPhone-XPath query wont retrieve my node -


I am using GDIT as my XML parser. I have tried to use XPath query to get a node - @ "// GetPlacesAutoCompleteResult". But getNodesForXPath does not return any nodes.

So I am asking, what is the wrong thing with what I have typed?

PS I'm just looking for a way to find out if the node is present or not, I do not care about the nodes of the child about it.

Here is my .xml file (resulting in a soap query .asmx in web-service).

   & Lt; Xs: element name = "full name" type = "xs: string" minOccurs = "0" /> & Lt; Xs: element name = "placetipid" type = "xs: int" minOccurs = "0" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; / XS: Options & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; / XS: Schema & gt; & Lt; Diffgr: diffgram xmlns: msdata = "vase: schema-microsoft-com: xml-msdata" xmlns: diffgr = "vase: schema-microsoft-com: xml-diffgram-v1" & gt; & Lt; New dataet xmlns = "" & gt; & Lt; Table Defrag: id = "Table1" msdata: rowOrder = "0" & ​​gt; & Lt; ID & gt; 47,393 & lt; / Id & gt; & Lt; FullName & gt; Yifat & lt; / FullName & gt; & Lt; PlaceTypeID & gt; 10 & lt; / PlaceTypeID & gt; & Lt; / Table & gt; & Lt; Table Defrag: id = "Table2" msdata: rowOrder = "1" & gt; & Lt; ID & gt; 48497 & lt; / Id & gt; & Lt; FullName & gt; Haifa & lt; / FullName & gt; & Lt; PlaceTypeID & gt; 10 & lt; / PlaceTypeID & gt; & Lt; / Table & gt; & Lt; Table defrag: id = "table3" msdata: rowOrder = "2" & gt; & Lt; ID & gt; 70,827 & lt; / Id & gt; & Lt; Full name & gt; Haifa - Central Bus Rishan & lt; / Full name & gt; & Lt; PlaceTypeID & gt; 120 & lt; / PlaceTypeID & gt; & Lt; / Table & gt; & Lt; / NewDataSet & gt; & Lt; / Diffgr: diffgram & gt; & Lt; / GetPlacesAutoCompleteResult & gt; & Lt; / GetPlacesAutoCompleteResponse & gt; & Lt; / Soap: Body & gt; & Lt; / Soap: Envelope & gt;    

Well & amp; Lieutenant; GetPlacesAutoCompleteResponse xmlns = "http: // xxxxxxx com / xxxxxx / webservice" & gt; GetPlacesAutoCompleteResult & gt; You have a default namespace declaration in Spip, so suppose that you use XPath 1.0, then you have to pair the prefix at the namespace URI http://xxxxxxx.com / Xxxxxx / webservice < Use that prefix to qualify for / code> and element names. For example if the prefix is ​​ ws you will use // ws: GetPlacesAutoCompleteResult .

How can you tie a prefix on a namespace URI? The XPath API you use, I'm not familiar with GDT so I can not help you with a code sample.

Comments