NSXMLParserErrorDomain error 64 - ios

I have to call xml parsing I am receiving this error "NSXMLParserErrorDomain error 64", if I will parse dynamically I will get this error. statically parsing on that same xml I get my attribute values.
If i will try another one server different request,url and response it will working properly the xml parsing and i am getting attribute values.

Please check this link==>http://brandontreb.com/wordpress-for-iphoneipad-nsxmlparsererrordomain-error-64-resolved
*After scouring the internet, I found that this could be the result of a few issues.
1) Special characters in a post body that are not supported by NSXMLParser
2) Special characters in a comment
3) Invalid post or comment RSS
4) An error in a theme/plugin file
For me, this turned out to be an issue with the comments RSS feed. I loaded it up in the browser and long behold, even the browser threw an error. But what could be causing this? Turns out, I had left a space in a plugin that I created. This caused a space to be output at the beginning of the comments XML, causing it to error. Notice the space between ?> and
After removing the space from this plugin, I loaded up WordPress for iPhone and it added my blog without a problem.
So, the take away from this is don’t output spaces when you create a plugin.*
Hope this helps you...:-)

In my case, it was only the blank line at the beginning of the file that was causing the issue. Error code 64 is for misplaced XML declaration as you can see in the documentation:
NSXMLParserMisplacedXMLDeclarationError = 64,
Misplaced XML declaration.

Related

White spaces are required between publicId and systemId, but XML looks OK

I just pulled out a piece of code which I wrote a few months ago. The code fetches an XML document from a web server and parses it using JAXB. The last time I tried it worked flawlessly; now I am getting an exception:
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 50; White spaces are required between publicId and systemId.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
Looking around, this suggests some issues with the XML header data, namely <!DOCTYPE ...>. The answer suggests that the statement is misleading: in the case described, systemId was missing altogether, despite the error just complaining about a missing whitespace in front of it.
However, if I get the XML document with a web browser, it doesn’t even contain the <!DOCTYPE ...> header.
Parsing an XML document I retrieved a few months back works without issues.
If I diff the document I retrieved today and the one from a few months back, both are exactly the same up to the start of the root element.
Capturing the HTTP traffic finally provided the answer (unencrypted connections come in handy at times): Apparently the service switched from HTTP to HTTPS in the last few months, with URLs remaining unchanged otherwise.
Requests to the old URL are answered with 301 Moved Permanently and the new URL.
When reading from a URL with java.net.URL.openStream(), redirects are not followed automatically. Thus, the data it returns is not valid XML, leading to the error message.
Lesson learned for today: White spaces are required between publicId and systemId is really just a cryptic way of saying: Something’s wrong with the XML data you supplied, but we didn’t bother to dig any deeper.

Rails: ORA-00911 error while executing query, doesn't appear when copy and pasted

We had some queries saved in a secondary database which are used to query an Oracle Database.
It kept showing us the ORA-00911 Invalid Character error, but we couldn't find it.
We searched for extra colons, semi-colons or comma as other suggested but we couldn't find it.
We then printed the query to the HTML output, copied it and pasted it on the console and it worked.
Are there any other possible characters that could fail?
What we finally did was to paste the query from the console to Visual Studio Code, and then we installed the extension Highlight Bad Chars. That showed us that some invalid characters (** **) were placed in the text.
We took the queries right from our Confluence site, maybe it got confused with some markup element that brought the error.

SAPUI5 invalid MIME part type with Remote oDATA Service

I need help showing the data from my own remote server with oDATA.
When I want to show the data in the view, I get the following error
invalid MIME part type.
These are the Captures of Error
my https://******/$metadata?
My Table control from SApui5 Course App example
Error when executing the application
And Console error
When I insert this.getModel().setUseBatch(false) in the init : function () of the Component.js, it does not give me the error, nor in the console, but it does not show me the records either .. Can someone give me an idea?
It's an old question, but recently I've got the same error with batch request processing and in my case the root cause was that when building batch processing response with content type multipart/mixed you have to use CRLF as a text line separator ('\r\n') and not only '\n'. See also here in multipart response specification. The hard part was that correct and incorrect responses look absolutely identical when debugging.

\u0092 is not printed in UILabel

I have a local json file with some descriptions of an app and I have found a weird behaviour when parsing \u0092 and \u0091 characters.
When json file contains these characters, the corresponding parsed NSString is printed like "?" and in UIlabel it dissapears completely.
Example "L\u2019H\u00e9r." is showed as "LHér." instead of "L'Hér."
If I replace this characters with \u2019, then I can see the caracter ' in UILabel
Does anybody any clue about this?
EDIT: For the moment I will substitute both of them with character \u2019, it is also a ' and there is no problem confusing it with a control character. Thank you all!
This answer is a little speculative, but I hope it gets you on the right tracks.
Your best bet may be to give up and substitute \u0091 and \u0092 for something else as a preprocessing step before string display. These are control characters and are unprintable in most encodings. But:
If rest of the file is proper UTF, your json file probably has problems: encoding is wrong (CP-1250?) while you read the file as UTF, some error has been made when converting the file, or a similar issue. So another solution is of course fixing your file.
If you're not sure about how your file is encoded, it may simply be encoded in CP-1250 - so reading the file using NSWindowsCP1250StringEncoding might fix your problem.
BTW, if you hardcode a string #"\u0091", you'll get a compilation time error Universal character name refers to a control character. Yes, not even a warning, it's that much unprintable in Unicode ;)

How to parse Nokogiri/libXML XML errors to human-friendly errors?

We are using Nokogiri to validate XML files using a XSD. The problem is that the error messages that Nokogiri generates are not very friendly and very hard to translate:
"Element '{http://www.portalfiscal.inf.br/nfe}infNFe': The attribute 'Id' is required but missing."
Does anyone know of a parser or any other way to capture the info needed from the error to generate a more human friendly error?
Until then, we will be doing a custom parser for them... ouch!
I created a gem for this that is now open source: https://rubygems.org/gems/xml_errors_parser
It seems to work pretty well so far, but number of errors parsed is very few for now. It is however very easy to add new errors, so we will be adding them as needed.
Code reviews and pull requests are always great :)

Resources