1

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!

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Wise Shepherd
  • 2,228
  • 4
  • 31
  • 43

2 Answers2

0

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".

0

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

<expire xsi:nil="true">
</expire>
Felix Yan
  • 14,841
  • 7
  • 48
  • 61
Izac Mac
  • 491
  • 3
  • 20