Latest 1.1.1
License BSD
Platforms ios 8.0, requires ARC


Build Status
CocoaPods Compatible
[GitHub contributors]()

EasyXMLParser is a simple and easy to use xml parser written in swift for iOs

Installation with CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C, which automates and simplifies the process of using 3rd-party libraries like EasyXMLParse in your projects. You can install it with the following command:

$ gem install cocoapods


To integrate EasyXMLParse into your Xcode project using CocoaPods, specify it in your Podfile:

source ''
platform :ios, '8.2'

target 'TargetName' do
pod 'EasyXMLParser', '~> 1.1'

Then, run the following command:

$ pod install


Parsing with a xml file

if let utilisateursFichier = Bundle.main.path(forResource: "utilisateurs", ofType: "xml") {
            if let utilisateursString = try? String(contentsOfFile: utilisateursFichier) {
                if let utilisateurData = .utf8) {

                    // Parse xml with EasyXMLParser
                    let parser = EasyXMLParser(withData: utilisateurData)
                    let items = parser.parse()

                    // data without filter
                    for item in items["utilisateurs"]["utilisateur"].getSiblingWithSameName() {

                    // data with filter
                    let filtreUtilisateur = ["utilisateur":["nom":"", "mail":""]]

                    for item in items.filter(filtre: filtreUtilisateur) {

                    // casting data
                    print("Code postal du premier utilisateur (int) : (items["utilisateurs"]["utilisateur"]["code_postal"].intValue)")
                    print("Code postal du premier utilisateur (float) : (items["utilisateurs"]["utilisateur"]["code_postal"].floatValue)n")


Exemple xml file

<?xml version="1.0" encoding="UTF-8" ?>
        <mail>[email protected]</mail>
        <telephone>16520424 5277</telephone>
        <addresse>2339 Vivamus Ave</addresse>
        <pay>American Samoa</pay>
        <mail>[email protected]</mail>
        <telephone>16140811 4054</telephone>
        <addresse>CP 406, 2955 Fusce Chemin</addresse>

Parsing with an url

if let url = URL.init(string: "") {

            if let xmlData = try? Data.init(contentsOf: url) {

                // Parse xml with EasyXMLParser
                let parser = EasyXMLParser(withData: xmlData)
                let letFluxRSS = parser.parse()

                // get channel data
                print("Nom du flux RSS : (letFluxRSS["rss"]["channel"]["title"].value)")
                print("Adress du flux RSS : (letFluxRSS["rss"]["channel"]["link"].value)")

                print("Nombre d'article du flux RSS : (letFluxRSS["rss"]["channel"]["item"].countSiblingWithSameName())")
                print("Nombre de données pour le premier article : (letFluxRSS["rss"]["channel"]["item"].countAllChildren()) nn")

                // get article data
                for article in letFluxRSS["rss"]["channel"]["item"].getSiblingWithSameName() {


EasyXMLParser is released under the BSD-3 license. See LICENSE for details.

Latest podspec

    "name": "EasyXMLParser",
    "version": "1.1.1",
    "summary": "EasyXMLParser is a simple and easy to use xml parser written in swift for iOs",
    "homepage": "",
    "license": {
        "type": "BSD",
        "file": "LICENSE"
    "authors": {
        "ESGI": "[email protected]"
    "source": {
        "git": "",
        "tag": "v1.1.1"
    "source_files": "EasyXMLParser/*.{swift,h}",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This