Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. I googled and found "AEXML" framework for SWIFT programming. I got confused to access the tags from "AEXMLElement".
  2.  
  3. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  4. <rss version="2.0">
  5. <channel>
  6. <title>ComputerWeekly: Latest IT News</title>
  7. <link>http://computerweekly.techtarget.com/rss/Latest-IT-news.xml</link>
  8. <description>Follow the latest technology news that matters to UK IT leaders and IT professionals, as it happens, from the UK’s leading technology publication.</description>
  9. <language>en-us</language>
  10. <copyright>Copyright TechTarget - All rights reserved.</copyright>
  11. <docs>http://computerweekly.techtarget.com/rss/Latest-IT-news.xml</docs>
  12. <generator>Techtarget Feed Generator</generator>
  13. <managingEditor>editor@computerweekly.com (Editor)</managingEditor>
  14. <webMaster>webmaster@techtarget.com (Webmaster)</webMaster>
  15. <ttl>60</ttl>
  16. <image>
  17. <width>175</width>
  18. <height>33</height>
  19. <title>ComputerWeekly</title>
  20. <link>http://computerweekly.techtarget.com/rss/Latest-IT-news.xml</link>
  21. </image>
  22. <lastBuildDate>Tue, 6 Oct 2015 03:36:45 EDT</lastBuildDate>
  23. <item>
  24. <title>UCHL mobile healthcare service demonstrates the potential future of the NHS</title>
  25. <link>http://www.computerweekly.com/news/4500254844/UCHL-mobile-healthcare-service-demonstrates-the-potential-future-of-the-NHS</link>
  26. <description>A mobile screening service which combines medical and information technologies could be an early example of healthcare in the future</description>
  27. <author>ComputerWeekly.com(editor@www.com)</author>
  28. <pubDate>Mon, 5 Oct 2015 12:20:50 EDT</pubDate>
  29. </item>
  30. <item>
  31. <title>Security Think Tank: Addressing the gap between security data and intelligence</title>
  32. <link>http://www.computerweekly.com/opinion/Security-Think-Tank-Addressing-the-gap-between-security-data-and-intelligence</link>
  33. <description>What is the best practice for collecting and using threat indicators from security incidents to improve defences against future cyber attacks?</description>
  34. <author>Mike Gillespie(editor@www.com</author>
  35. <pubDate>Mon, 5 Oct 2015 12:00:07 EDT</pubDate>
  36. </item>
  37. </channel>
  38. </rss>
  39.  
  40. let xmlDoc = try AEXMLDocument(xmlData: responseData!)
  41. if let items = xmlDoc.root ["channel"]["item"].all {
  42. print("Items: (items)")
  43. for item in items {
  44. print("Item: (item.value)")
  45. if let name = item.value {
  46. print("Name: (name)")
  47. }
  48. }
  49. }
  50.  
  51. Items: [<RevealControllerDemo.AEXMLElement: 0x7f98e3d68ec0>, <RevealControllerDemo.AEXMLElement: 0x7f98e3d70440>, <RevealControllerDemo.AEXMLElement: 0x7f98e3d74b70>, <RevealControllerDemo.AEXMLElement: 0x7f98e3d799f0>, <RevealControllerDemo.AEXMLElement: 0x7f98e3eebb20>, <RevealControllerDemo.AEXMLElement: 0x7f98e3ef90c0>, <RevealControllerDemo.AEXMLElement: 0x7f98e6002d90>, <RevealControllerDemo.AEXMLElement: 0x7f98e6006da0>, <RevealControllerDemo.AEXMLElement: 0x7f98e600c620>, <RevealControllerDemo.AEXMLElement: 0x7f98e6010de0>, <RevealControllerDemo.AEXMLElement: 0x7f98e60152b0>, <RevealControllerDemo.AEXMLElement: 0x7f98e601c710>, <RevealControllerDemo.AEXMLElement: 0x7f98e6022290>, <RevealControllerDemo.AEXMLElement: 0x7f98e6026790>, <RevealControllerDemo.AEXMLElement: 0x7f98e602b560>, <RevealControllerDemo.AEXMLElement: 0x7f98e60316b0>, <RevealControllerDemo.AEXMLElement: 0x7f98e6036480>, <RevealControllerDemo.AEXMLElement: 0x7f98e603ad50>, <RevealControllerDemo.AEXMLElement: 0x7f98e60414a0>, <RevealControllerDemo.AEXMLElement: 0x7f98e6045560>]
  52. Item: nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement