我使用NSXMLParser解析一個xml包,我在包文本中收到&。nsxmlparser解決不了'
我有以下的XMLPARSER定義:
[xmlParser setShouldResolveExternalEntities: YES];
下面的方法不會被調用
- (void)parser:(NSXMLParser *)parser foundExternalEntityDeclarationWithName:(NSString *)entityName publicID:(NSString *)publicID systemID:(NSString *)systemID
的&者之前在字段中的文本不會被解析器考慮。
我正在尋找如何解決這個,任何想法???
預先感謝附 亞歷
XML封裝部分:
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:appwsdl"><SOAP-ENV:Body><ns1:getObjects2Response xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"><return xsi:type="tns:objectsResult"><totalRecipes xsi:type="xsd:string">1574</totalObjects><Objects xsi:type="tns:Item"><id xsi:type="xsd:string">4311</id><name xsi:type="xsd:string"> item title 1 </name><procedure xsi:type="xsd:string">item procedure 11......
我接觸了XML部分,解析器對&amp相同,非常感謝您的幫助。 – alex 2009-11-20 21:15:39
我遠離我的Mac,因此我現在無法運行測試,但是您是否嘗試過'foundInternalEntityDeclarationWithName'? – 2009-11-20 22:56:36
是的,我嘗試了所有的實體相關的代表,沒有人被稱爲:( 感謝很多的Epsilon :) – alex 2009-11-20 23:15:24