• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unable to parse xml
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 "&lt;". 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>
&lt;?xml version="1.0" encoding="utf-16"?>
&lt;CurrentWeather>
&lt;Location>Sion, Switzerland (LSGS) 46-13N 007-20E 481M&lt;/ Location>
&lt;Time>Aug 09, 2006 - 05:20 AM EDT / 2006.08.09 0920 UTC&lt;/Time>
&lt;Wind> from the WSW (250 degrees) at 5 MPH (4 KT) (direction
variable):0&lt;/Wind>
&lt;Visibility> greater than 7 mile(s):0&lt;/Visibility>
&lt;SkyConditions> mostly clear&lt;/SkyConditions>
&lt;Temperature> 68 F (20 C)&lt;/Temperature>
&lt;DewPoint> 53 F (12 C)&lt;/DewPoint>
&lt;RelativeHumidity> 59%&lt;/RelativeHumidity>
&lt;Pressure> 29.91 in. Hg (1013 hPa)&lt;/Pressure>
&lt;Status>Success&lt;/Status>
&lt;/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 "&lt;" 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
  • Follow-Ups:
    • Re: Unable to parse xml
      • From: Pascal Pochet <email@hidden>
References: 
 >Unable to parse xml (From: "Anthony Mittaz" <email@hidden>)

  • Prev by Date: Unable to parse xml
  • Next by Date: Re: NSPopupButton
  • Previous by thread: Unable to parse xml
  • Next by thread: Re: Unable to parse xml
  • Index(es):
    • Date
    • Thread