Re: How to return data for NXSMLParserDelegate's -parser:resolveExternalEntityName:systemID:


Keary Suska
 

IRC, NSXMLParser is pretty vanilla, and back in the day it was recommended to use an xml parsing library directly rather than NSXMLParser if you have to work with anything except basic XML. Does not seem like Apple has improved it since then. That being said, technically, there are only a small set of “standard” entities: <, >, ', " and &. All other entities must be declared.

FWIW, the commonly accepted solution seems to be to pre-convert entities before passing passing to NSXMLParser. As long as the result is valid utf-8, it won’t choke the parser.

The most comprehensive discussion I could find was this one: https://stackoverflow.com/questions/2370842/resolving-html-entities-with-nsxmlparser-on-iphone which may or may not have an alternative solution.

HTH,

Keary Suska
Esoteritech, Inc.

On Dec 11, 2019, at 6:40 AM, Steve Mills via Groups.Io <sjmills=mac.com@groups.io> wrote:

I also wonder (thanks to the lack of documentation) if I should be supplying some standard urls in the allowedExternalEntityURLs property of the NSXMLParser. Would that cause the parser to automatically resolve standard entities? If so, what urls would do that? I haven't been able to find them on sites like w3.org or w3schools.com.

--
Steve Mills
Drummer, Mac geek



Join cocoa@apple-dev.groups.io to automatically receive all group messages.