我使用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