NSXMLParser error 201 when it reaches xsi:nil
-
29-09-2019 - |
문제
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!
올바른 솔루션이 없습니다
다른 팁
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".
제휴하지 않습니다 StackOverflow