Closed GoogleCodeExporter closed 8 years ago
Update on this bug would be nice.
Original comment by thetazz...@gmail.com
on 21 Jan 2009 at 3:01
I'll look at bug as time/resources allow.
Don't forget that you have the access to all the source and the community would
welcome any fixes.
Feel free to support TouchCode via http://toxicsoftware.com/touchcodedonate/ if
that floats your boat.
Original comment by jwight
on 21 Jan 2009 at 3:08
Hi there,
After searching al lot in the cloud for this issue I realized that this was a
problem
faced by several RSS client developers. For my iphone app I am now using
NSXMLParser
which is just a light weight parser with no xpath support.
Thanks
Abhang
Original comment by rane.abh...@gmail.com
on 21 Jan 2009 at 5:33
Closing.
Original comment by jwight
on 28 Feb 2009 at 7:10
I think this is related to issue #37, so I'm posting this information in that
thread as well.
This issue is actually related to how libxml2 works. With atom feeds, the
default namespace has to be defined
and used in your XPath queries, or you have to construct your XPath queries so
that they specifically handle
the default namespace.
I figured this out from this page:
http://philwilson.org/blog/2007/11/parsing-atom-with-libxml2
Without defining any namespaces, you need to use this kind of XPath query:
//*[local-name()='feed']
instead of this:
//feed
Here's how you can define namespaces with TouchXML when querying for XPath.
This example is against an
atom feed generated by ADO.NET Data Services:
DataServiceParser *dataServiceParser = [[DataServiceParser alloc]
initWithContentsOfURL:urlUpdateDataService
options:0 error:&error];
if(dataServiceParser) {
NSArray *entries;
NSDictionary *dictNameSpaceMappings = [[NSDictionary alloc]
initWithObjects:[NSArray
arrayWithObjects:@"http://www.w3.org/2005/Atom",
@"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata", nil]
forKeys:[NSArray arrayWithObjects:@"atom", @"m", nil]];
entries = [dataServiceParser nodesForXPath:@"/atom:feed/atom:entry/atom:content/m:properties"
namespaceMappings:dictNameSpaceMappings error:&error];
So, I wouldn't consider this a bug or issue with TouchXML, it's just a
technique you must use for atom feeds
with any XML library based on libxml2.
Original comment by mitch.h...@gmail.com
on 6 Jun 2009 at 11:52
Original issue reported on code.google.com by
rane.abh...@gmail.com
on 8 Dec 2008 at 7:21