A NSXMLParserErrorDomain #64 is thrown by NSXMLParser if it finds the following line:
<?xml version="1.0"?>
Makes no difference if I initWithContentsOfUrl or initWithData. The xml is coming via a php5.3 apache system. If this line is omitted the document parses without error. We own the server so I can filter this line out, but I’d rather fix the parser.
Are you sure there’s not some cruft on the line, like a byte order mark or other hidden characters? It’s the only thing I could think of that would cause an error on that line, assuming of course this is the first line in the document?
Also, adding
encoding="UTF-8"might help, but again, it must be the very first line of the document, and watch for hidden characters, mistyped spaces (nbsp-s instead of spaces, etc.), and so on.