Re: Unable to parse xml
Re: Unable to parse xml
- Subject: Re: Unable to parse xml
- From: "I. Savant" <email@hidden>
- Date: Fri, 8 Sep 2006 10:19:05 -0400
Your XML is invalid. Note the lines that begin with "<". It's
escaping the "<" character, rather than using it literally. Wherever
source you're getting this from, it's mangling the XML.
--
I.S.
On Sep 8, 2006, at 10:04 AM, Anthony Mittaz wrote:
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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