Ignoring invalid namespace link in NSXMLDocument?
Christiaan Hofman <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
I am trying to parse XML using NSXMLDocument and the -nodesForXPath:error: method of NSXMLNode. However, the XML I'm getting often has an invalid link in the xmlns attribute (for the name space) in a crucial element. The result apparently is that -nodesForXPath:error: does not find these nodes (or any of its children), even though I know they're there. As a case in point, when I remove the xmlns attribute, the method does return the nodes I'm looking for, though in practice of course I can't control the input. IMHO, I think it's a bug that it simply fails, and moreover silently (i.e. the error is not set), as the XML itself is perfectly valid. I don't think the result of parsing XML should depend on something that happens in some remote location. Note that I did NOT set the validation option when creating the XML document. Anyway, my question is whether someone knows a way for -nodesForXPath:error: to ignore such questionable errors, and simply parse the XML without further validation? I could not find any relevant optionss. Thanks, Christiaan