Kevin,
> I see -abortParse and parseErrorOccurred: as there for when your
> parser chokes on the data.
> I think you're jumping in a bit early by using abort.
Okay, I've got it. Thanks very much for the input! I plan to answer my
question on StackOverflow and I'll give you a mention unless you
ob
> So you are not getting a parsing error, you're using the wrong mechanism.
I think I see what you are saying. When my parser encounters an
element called "Error", I know that I don't need any more parsing done
no matter what else is in the data, so it seemed sensible to have the
delegate stop the
Hi Josh,
So you are not getting a parsing error, you're using the wrong mechanism. By
calling abort you are setting the parsers error code, that code has nothing to
do with the fact you are parsing some XML with "error" in it. I think you are
confusing a Parsing Error and a valid XML stream wit
>This error is the parser state, which since you explicitly aborted ?>the
>parse, will be something like >"NSXMLParserDelegateAbortedParseError" -512.
Yes, as I said in my original post. The parser's delegate gets error
512, NSXMLParserDelegateAbortedParseEr
ted the parser (which knows not a
thing about your concepts of "Error" and "ErrorMessage" as returned by the
server):
- (NSError *)parserError; // can be called after a parse is over to
determine parser state.
This error is the parser state, which since you explicitly
Hi Kevin,
Thanks for your reply.
Sorry, maybe my explanation is not clear enough (I may have left out
too many details). It's not a network error that I am talking about,
but, as you say, an API error for which the server returns valid XML.
The specifics:
I'm requesting weather data for a locati
Hi Josh,
I'm not sure that is the best place to be checking for a server/network error.
If there was an API error, I would have thought the server would have returned
valid XML with the error details, which should parse and not cause an parser
error. I'd look at downloading the file, determine
error text in an alert sheet, so the user has
some idea what may have gone wrong. My parser delegate facilitates this by
saving the contents of the ErrorMessage element that the parser finds, and
then calling [parser abortParsing]
The error code that results from this is supposed to be code 512,