Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sjsyrek/swift-xml-parser-example
Swift XML Parser
https://github.com/sjsyrek/swift-xml-parser-example
Last synced: about 1 month ago
JSON representation
Swift XML Parser
- Host: GitHub
- URL: https://github.com/sjsyrek/swift-xml-parser-example
- Owner: sjsyrek
- Created: 2014-07-25T03:55:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-04T16:23:27.000Z (over 9 years ago)
- Last Synced: 2024-03-18T16:22:55.274Z (8 months ago)
- Language: Swift
- Homepage:
- Size: 143 KB
- Stars: 8
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwiftXMLParserExample
## An example of how to use NSXMLParser from the Cocoa library to parse XML in Swift
### Updated for Swift 2.0 and Xcode7-Beta2This is a working example of an XML parser written in Swift but using Cocoa APIs to handle the heavy lifting. It’s based partly on one of Apple’s own example applications and is presently designed to read a specific XML file (included) but could be generalized and made much more Swifty. It’s only a preliminary experiment, and I am not a professional developer. There is also quite a bit that could be done to make this code conform to best Swift practice (such as it is). Feel free to borrow from this repository if you think it could be useful for your own projects.
###### Note: make sure you update the `path` constant in the test section for your own system.
Changelog
- 2015-07-04: Updated for Swift 2.0. The project builds and runs successfully in Xcode7-Beta2 on my machine, but it still does not seem to work in a playground.
- 2014-07-25: The code works in playground and compiles to executable in Xcode6-Beta3 on my machine, but doesn't seem to work in Beta4.
- 2014-08-13: Code works in compiler but not playground in Beta 5 (some issue with NSXMLParser).