我在 xcode 工作;我有一个 NSArray 数据,我想将其转换为 XML 文件,然后上传到 Web 数据库。
数组的格式如下:
555ttt Conor Brady testpass BC test Desc this is user timestamp this is location this is user location
我希望它转换成 XML 文件,如下所示:
<plates>
<plate>
<plateno>555ttt</plateno>
<user>Conor Brady</user>
<username>cbrady</username>
<password>testpass</password>
<province>BC</province>
<description>test desc</description>
<usertimestamp>this is user timestamp</usertimestamp>
<location>this is user location</location>
<status>this is user status</status>
</plate>
<plate>
<plateno>333yyy</plateno>
<user>C Brady</user>
<username>cbrady</username>
<password>testpass</password>
<province>BC</province>
<description>This is a test description</description>
<usertimestamp>this is user timestamp</usertimestamp>
<location>this is user location</location>
<status>this is user status</status>
</plate>
</plates>
有什么建议吗?