Question

I have a NSXMLParser parsing and XML source and one of my tags is <expire xsi:nil="true"/>. When the parser reaches this tag, it throws an NSXMLParserErrorDomain error 201. If I remove this tag from my XML source, I get no error.

Any ideas why this is throwing an error??

Thanks!

No correct solution

OTHER TIPS

Yes. The / in the end of this tag seems to be the issue. To close it properly, try

<expire xsi:nil="true">
</expire>

I got this error when I didn't add the URI for the namespace. So you should define in the root element the URI for your namespace like this:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:im="http://itunes.apple.com/rss" xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <entry>
    <im:name>Angry Birds Star Wars</im:name>
  </entry>
</feed>

Where "im" is the namespace like yours "xsi".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top