Unable to parse xml
Unable to parse xml
- Subject: Unable to parse xml
- From: "Anthony Mittaz" <email@hidden>
- Date: Fri, 8 Sep 2006 16:04:35 +0200 (CEST)
- Importance: Normal
Hello,
I'm unable to parse that xml file, is there somehone how can help me ?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetWeatherResponse xmlns="http://www.webserviceX.NET">
<GetWeatherResult>
<?xml version="1.0" encoding="utf-16"?>
<CurrentWeather>
<Location>Sion, Switzerland (LSGS) 46-13N 007-20E 481M</Location>
<Time>Aug 09, 2006 - 05:20 AM EDT / 2006.08.09 0920 UTC</Time>
<Wind> from the WSW (250 degrees) at 5 MPH (4 KT) (direction
variable):0</Wind>
<Visibility> greater than 7 mile(s):0</Visibility>
<SkyConditions> mostly clear</SkyConditions>
<Temperature> 68 F (20 C)</Temperature>
<DewPoint> 53 F (12 C)</DewPoint>
<RelativeHumidity> 59%</RelativeHumidity>
<Pressure> 29.91 in. Hg (1013 hPa)</Pressure>
<Status>Success</Status>
</CurrentWeather>
</GetWeatherResult>
</GetWeatherResponse>
</soap:Body>
</soap:Envelope>
What i'm doing is that:
NSXMLElement *rootElement, *tmpElement;
rootElement = [responseXML rootElement];
tmpElement = [[rootElement elementsForName:@"soap:Body"] lastObject];
tmpElement = [[tmpElement elementsForName:@"GetWeatherResponse"]
lastObject];
tmpElement = [[tmpElement elementsForName:@"GetWeatherResult"] lastObject];
(responseXML is my xml file]
It does work until "GetWeatherResult" but after i cannot go further,
probably because of theses "<" coming from html
What i want is for exemple "Sion, Switzerland (LSGS) 46-13N 007-20E 481M"
in an NSString...
I hope somehone would give me an answer...
Anthony
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden