views:

256

answers:

1

Hi!

Im using NSXMLParser to dissect a xml package, I'm receiving &apos inside the package text.

I have the following defined for the xmlParser:

[xmlParser setShouldResolveExternalEntities: YES];

The following method is never called

- (void)parser:(NSXMLParser *)parser foundExternalEntityDeclarationWithName:(NSString *)entityName publicID:(NSString *)publicID systemID:(NSString *)systemID

The text in the field before the &apos is not considered by the parser.

Im searching how to solve this, any idea???

Thanks in advance Alex

XML package portion attached:

<?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/"&gt;&lt;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......
A: 

The standard entities are &lt;, &gt;, &amp;, and &quot;. &apos; is an html entity reference. Does your XML refer to the XHTML namespace or some other namespace that has &apos; defined?

(BTW, would be nice to see a small segment of the XML including the header.)

Epsilon Prime
alex
I'm away from my Mac so I can't run a test at the moment, but have you tried `foundInternalEntityDeclarationWithName`?
Epsilon Prime
Yes, I tried all the entity related delegates and no one is called :( Thanks a lot Epsilon :)
alex
Looks like three20 uses resolveExternalEntityName to fill in the list of entities to parse:http://github.com/facebook/three20/blob/8183ae25528bbc575ab41a41227756f06c166240/src/NSStringAdditions.m
Epsilon Prime