J'utilise TouchXML pour analyser les fichiers XML entrants. Jusqu'à présent, tout a bien fonctionné, mais avec ce dossier, je suis d'avoir beaucoup de problèmes:TouchXML: Problèmes de lecture d'informations EDSP avec Iphone
<item>
<title><![CDATA[Hotel Katschberghof]]></title>
<edsp:uid>92090</edsp:uid>
<link>http://test.dataapi.herold.at/search?aId=yasssu&auth=MjAxMDExMDgwNTAwMDA6TkRobU1HVXdNVGt6T1RabFpUQTJZalV4WXpBeE1qa3pZbUZsTmpjM01qST0NCg%3D%3D&c=15&provider=&q=PN1VW&type=yp_detail</link>
<description><![CDATA[Betrieben wird ein 4 Sterne Hotel mit ca. 140 Betten. Mit 29.04.2008 wurde die Einzelfirma Christine Kröth in die gegenständliche Einzelfirma eingebracht.]]></description>
<guid>PN1VW</guid>
<georss:point>47.0579478809204 13.6152591216261</georss:point>
<geo:point>
<geo:lat>47.0579478809204</geo:lat>
<geo:long>13.6152591216261</geo:long>
</geo:point>
<edsp:itemExt type="ds">
<edsp:fReq reqVStr="Details">
<edsp:reqQStr>http://test.dataapi.herold.at/search?aId=yasssu&auth=MjAxMDExMDgwNTAwMDA6TkRobU1HVXdNVGt6T1RabFpUQTJZalV4WXpBeE1qa3pZbUZsTmpjM01qST0NCg%3D%3D&c=15&provider=&q=PN1VW&type=yp_detail
</edsp:reqQStr>
</edsp:fReq>
<edsp:coord lat="47.0579478809204" long="13.6152591216261" />
<edsp:contact>
<edsp:cName fN="" lN="Hotel Katschberghof" />
<edsp:cInfo>
<edsp:tel>+4347342660</edsp:tel>
<edsp:fax>+434734406</edsp:fax>
<edsp:eml>[email protected]</edsp:eml>
<edsp:web>http://www.katschberghof.at</edsp:web>
</edsp:cInfo>
<edsp:cAddr str="Nr. 4" pCd="9863" cty="Katschberghöhe"
cnt="A" />
</edsp:contact>
</edsp:itemExt>
<edsp:itemInfo type="lst">
<edsp:lstDetails>
<edsp:actionProps>
<edsp:actionProp action="showMapLink" enabled="true" />
<edsp:actionProp action="showRouteLink" enabled="true" />
<edsp:actionProp action="showFacebookLink"
enabled="false" />
<edsp:actionProp action="showVideoLink" enabled="false" />
<edsp:actionProp action="showDiaLink" enabled="false" />
<edsp:actionProp action="showVoucherLink" enabled="false" />
</edsp:actionProps>
</edsp:lstDetails>
<edsp:styleProps>
<edsp:styleProp styleRef="mobEuro" />
</edsp:styleProps>
</edsp:itemInfo>
</item>
Maintenant, je tente de chercher // élément, mais pas obtenir toutes les informations pertinentes (principalement: edsp: contact et géo : latitude)
NSString *XMLPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"testhotels.xml"];
NSData *XMLData = [NSData dataWithContentsOfFile:XMLPath];
CXMLDocument *doc = [[[CXMLDocument alloc] initWithData:XMLData options:0 error:nil] autorelease];
NSLog(@"Starting XML Parsing");
NSArray *nodes = NULL;
pour (CXMLElement * nœud nœuds) {
item = [[NSMutableDictionary alloc] init];
int counter;
for(counter = 0; counter < [node childCount]; counter++) {
// [item setObject:[[node childAtIndex:counter] stringValue] forKey:[[node childAtIndex:counter] name]];
NSString * value = [[[node childAtIndex:counter] stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([value length] != 0){
[item setObject:[[node childAtIndex:counter] stringValue] forKey:[[node childAtIndex:counter] localName]]; //localName]];
}
}
[res addObject:item];
NSLog(@"test 1: %@", [[item valueForKey:@"edsp"] stringValue]);
[item release];
}
NSLog(@"%@", res);
[res release];
Et voici le fichier journal:
{
description = "Betrieben wird ein 4 Sterne Hotel mit ca. 140 Betten. Mit 29.04.2008 wurde die Einzelfirma Christine Kr\U00f6th in die gegenst\U00e4ndliche Einzelfirma eingebracht.";
guid = PN1VW;
itemExt = "\n\t\t\t\t\n\t\t\t\t\thttp://test.dataapi.herold.at/search?aId=yasssu&auth=MjAxMDExMDgwNTAwMDA6TkRobU1HVXdNVGt6T1RabFpUQTJZalV4WXpBeE1qa3pZbUZsTmpjM01qST0NCg%3D%3D&c=15&provider=&q=PN1VW&type=yp_detail\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t+4347342660\n\t\t\t\t\t\t+434734406\n\t\t\t\t\t\[email protected]\n\t\t\t\t\t\thttp://www.katschberghof.at\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t";
link = "http://test.dataapi.herold.at/search?aId=yasssu&auth=MjAxMDExMDgwNTAwMDA6TkRobU1HVXdNVGt6T1RabFpUQTJZalV4WXpBeE1qa3pZbUZsTmpjM01qST0NCg%3D%3D&c=15&provider=&q=PN1VW&type=yp_detail";
point = "\n\t\t\t\t47.0579478809204\n\t\t\t\t13.6152591216261\n\t\t\t";
title = "Hotel Katschberghof";
uid = 92090;
}
Merci pour toute suggestion comment résoudre ce problème ...
BR,
Stefan