的NSXMLParser实体问题
问题描述:
我有一个返回.NET Web服务如下:的NSXMLParser实体问题
<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 & M</City>
<CountryStateName>Florida</CountryStateName>
<CountryName>United States</CountryName>
</AddressLocation>
</ArrayOfAddressLocation>
我试图分析出这个城市节点的每个位置,但是,我得到后是一个换行符在&
在控制台:
//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
我不明白的是,&
是有效的XML,但它不维护节点的值...
答
的解析器发送三次“parser:foundCharacters:
”消息。如果将日志语句移至parser:didEndElement:namespaceURI:qualifiedName:
委托方法,您将看到整个字符串没有由NSLog
函数添加的换行符。