开发者

NSXMLParser Entity Problem

I have a .NET web service that is returning the following:

<ArrayOfAddressLocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"> 
  <AddressLocation> 
    <AddressLocationId>0</AddressLocationId> 
    <SubscribedCount>0</SubscribedCount> 
    <City>Florida A &amp; M</City> 
    <CountryStateName>Florida</CountryStateName> 
  开发者_开发知识库  <CountryName>United States</CountryName> 
  </AddressLocation>
</ArrayOfAddressLocation>

I am trying to parse out the city node of this for each location, however, I am getting a line break after the & in the console:

//2010-09-28 11:14:02.121 Appt Pal[8296:207] Florida A
//2010-09-28 11:14:02.121 Appt Pal[8296:207] &
//2010-09-28 11:14:02.121 Appt Pal[8296:207] M

What I don't understand is that the &amp; is valid XML, but it is not maintaining the node's value...


The parser is sending the parser:foundCharacters: message three times. If you move your log statement to the parser:didEndElement:namespaceURI:qualifiedName: delegate method, you will see the entire string without the line breaks that are added by the NSLog function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜