allen58992008 / touchcode

Automatically exported from code.google.com/p/touchcode
0 stars 0 forks source link

XPath doesn't function at all for when retrieving .NET web service data #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call any .NET webservice
2. Query the resulting XMLDocument with nodesForXPath

What is the expected output? What do you see instead?
It is expected that [theNodes count] would be equal to or greater than 1 if
the node exists but it is always 0.

What version of the product are you using? On what operating system?
Current SVN version;

Please provide any additional information below.
Example .NET web service:

http://www.webservicex.net/WeatherForecast.asmx/GetWeatherByZipCode?ZipCode=9202
4

Example nodesForXPath that doesnt work:

Call theNodes = [theXMLDocument nodesForXPath:@"StateCode" error:&theError];

Original issue reported on code.google.com by mdes...@gmail.com on 23 Apr 2008 at 9:47

GoogleCodeExporter commented 8 years ago
"Works as intended"

The XML you provided has an XML namespace. Internally we're using the libxml2 
xpath function. This function, 
this doesn't work quite the same way as NSXMLDocument namespaces and you need 
to manually specify the 
namespace mappings yourself. See: 
http://code.google.com/p/touchcode/issues/detail?id=4

Original comment by jwight on 23 Apr 2008 at 10:03

GoogleCodeExporter commented 8 years ago
See CXMLNode_XPathExtensions.h for the new method that allows you to specify 
the mapping.

Original comment by jwight on 23 Apr 2008 at 10:04

GoogleCodeExporter commented 8 years ago
Awesome.  I got it working with no issues now.  Thanks for the incredibly fast
response and I apologize for not finding that on my own.

Original comment by mdes...@gmail.com on 23 Apr 2008 at 10:25

GoogleCodeExporter commented 8 years ago
My pleasure. I need to do a better job documenting the new method(s).

Original comment by jwight on 23 Apr 2008 at 10:35