在 iPhone 中解析 XML 文件
我需要从网站解析 XML 文件。我已经浏览了一些链接,如 ray wenderlich 等,但首先我需要知道 XML 解析是如何工作的。所以我决定解析一个简单的 xml 文件,如下所示。
<?xml version="1.0" encoding="UTF-8"?>
<employees>
<emp id = "100" name = "Cyril">
<details>
<desc>This Employee is working in this company for the past 5 years
</desc>
<age>35</age>
</details>
</emp>
<emp id = "101" name = "Ram">
<details>
<desc>This Employee is working in this company for the past 3 years
</desc>
<age>28</age>
</details>
</emp>
</employees>
谁能帮助我吗?
I need to parse a XML file from the website.I have went through some links like ray wenderlich,etc.,But first i need to know how the XML parsing is working. So i have decided to parse a simple xml file which is given below.
<?xml version="1.0" encoding="UTF-8"?>
<employees>
<emp id = "100" name = "Cyril">
<details>
<desc>This Employee is working in this company for the past 5 years
</desc>
<age>35</age>
</details>
</emp>
<emp id = "101" name = "Ram">
<details>
<desc>This Employee is working in this company for the past 3 years
</desc>
<age>28</age>
</details>
</emp>
</employees>
Can anyone help me ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 NSXMLParser 进行相同的操作,并且需要实现其委托,您将在其中接收解析的值。
you can use NSXMLParser for the same and you need to implement its delegates where you will receive the parsed values.