├── .gitignore ├── Assets └── >.png ├── LICENSE ├── README.md ├── XMLParser Demo ├── Podfile ├── Podfile.lock ├── Pods │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── Target Support Files │ │ ├── Pods-XMLParser Demo │ │ │ ├── Info.plist │ │ │ ├── Pods-XMLParser Demo-acknowledgements.markdown │ │ │ ├── Pods-XMLParser Demo-acknowledgements.plist │ │ │ ├── Pods-XMLParser Demo-dummy.m │ │ │ ├── Pods-XMLParser Demo-frameworks.sh │ │ │ ├── Pods-XMLParser Demo-resources.sh │ │ │ ├── Pods-XMLParser Demo-umbrella.h │ │ │ ├── Pods-XMLParser Demo.debug.xcconfig │ │ │ ├── Pods-XMLParser Demo.modulemap │ │ │ └── Pods-XMLParser Demo.release.xcconfig │ │ └── XMLParser │ │ │ ├── Info.plist │ │ │ ├── XMLParser-Private.xcconfig │ │ │ ├── XMLParser-dummy.m │ │ │ ├── XMLParser-prefix.pch │ │ │ ├── XMLParser-umbrella.h │ │ │ ├── XMLParser.modulemap │ │ │ └── XMLParser.xcconfig │ └── XMLParser │ │ ├── LICENSE │ │ └── XMLParser │ │ ├── Dictionary+XMLParser.swift │ │ ├── String+XMLParser.swift │ │ ├── Tree.swift │ │ ├── XMLCoder.swift │ │ ├── XMLDecoder.swift │ │ └── XMLParser.swift ├── XMLParser Demo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── XMLParser Demo.xcworkspace │ └── contents.xcworkspacedata ├── XMLParser Demo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift └── XMLParser DemoTests │ ├── Info.plist │ └── XMLParser_DemoTests.swift ├── XMLParser.podspec └── XMLParser ├── Dictionary+XMLParser.swift ├── String+XMLParser.swift ├── Tag.swift ├── Tree.swift ├── XMLCoder.swift ├── XMLDecoder.swift ├── XMLParser.swift └── XMLTag.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | 28 | # Carthage 29 | # 30 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 31 | # Carthage/Checkouts 32 | 33 | Carthage/Build 34 | -------------------------------------------------------------------------------- /Assets/>.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mozharovsky/XMLParser/062bb7fb8425c0151704421e348fa5707d4fb4a6/Assets/>.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Eugene Mozharovsky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | Overview 6 | ========== 7 | * [Description](https://github.com/Mozharovsky/XMLParser#description) 8 | * [Requirements](https://github.com/Mozharovsky/XMLParser#requirements) 9 | * [Installation](https://github.com/Mozharovsky/XMLParser#installation) 10 | * [Usage](https://github.com/Mozharovsky/XMLParser#usage) 11 | * [Author](https://github.com/Mozharovsky/XMLParser#author) 12 | * [License](https://github.com/Mozharovsky/XMLParser#license) 13 | 14 | Description 15 | ========== 16 | XMLParser lets you convert a pure Swift dictionary into XML string and vice versa. 17 | 18 | Requirements 19 | ========== 20 | * Swift 2 (Xcode 7+) 21 | * iOS 8+ 22 | * ARC 23 | 24 | Installation 25 | ========== 26 | 27 | ###Cocoa Pods 28 | ```ruby 29 | pod 'XMLParser', '~> 1.0' 30 | ``` 31 | 32 | Usage 33 | ========== 34 | 35 | ####Parsing an XML string from a Dictionary 36 | ```swift 37 | let body = [ 38 | "request" : [ 39 | "meta" : [ 40 | "type" : "getOrder", 41 | "date" : "2015-08-29 12:00:00", 42 | "device_name" : "iPhone 6 Plus", 43 | "device_os_version" : "iOS 9" 44 | ] 45 | ], 46 | 47 | "encryption" : [ 48 | "type" : "RSA" 49 | ] 50 | ] 51 | 52 | let header = "\n" 53 | let result = XMLParser.sharedParser.encode(body, header: header) 54 | print(result) 55 | ``` 56 | 57 | ####Result 58 | ```XML 59 | 60 | 61 | RSA 62 | 63 | 64 | 65 | getOrder 66 | iOS 9 67 | 2015-08-29 12:00:00 68 | iPhone 6 Plus 69 | 70 | 71 | ``` 72 | 73 | ####Associated tags 74 | E.g. `0` 75 | ```swift 76 | let data = [ 77 | "tr" : [ 78 | XMLTag(header: "td", name: "class", value: "num") : 1, 79 | XMLTag(header: "td", name: "class", value: "achievments") : 0, 80 | XMLTag(header: "td", name: "class", value: "sum") : 205 81 | ] 82 | ] 83 | 84 | let result = XMLParser.sharedParser.encode(data) 85 | print(result) 86 | ``` 87 | 88 | ####Result 89 | ```XML 90 | 91 | 0 92 | 1 93 | 205 94 | 95 | ``` 96 | 97 | ========== 98 | 99 | 100 | ####Extracting data from an XML converted string 101 | ```swift 102 | let convertedString = "getOrder2015-08-29 12:00:00iPhone 6 PlusiOS 9RSA" 103 | let result = XMLParser.sharedParser.decode(convertedString) 104 | print(result) 105 | ``` 106 | 107 | ####Result 108 | ```swift 109 | [ 110 | type: [getOrder, RSA], 111 | device_os_version: [iOS 9], 112 | date: [2015-08-29 12:00:00], 113 | device_name: [iPhone 6 Plus] 114 | ] 115 | ``` 116 | 117 | 118 | Author 119 | ========== 120 | Eugene Mozharovsky ([@DottieYottie](https://twitter.com/DottieYottie)) 121 | 122 | [License](https://github.com/Mozharovsky/XMLParser/blob/master/LICENSE) 123 | ========== 124 | -------------------------------------------------------------------------------- /XMLParser Demo/Podfile: -------------------------------------------------------------------------------- 1 | target 'XMLParser Demo' do 2 | platform :ios, '8.0' 3 | use_frameworks! 4 | pod 'XMLParser', '~> 1.0' 5 | end -------------------------------------------------------------------------------- /XMLParser Demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - XMLParser (1.0) 3 | 4 | DEPENDENCIES: 5 | - XMLParser (~> 1.0) 6 | 7 | SPEC CHECKSUMS: 8 | XMLParser: e737ced4d8e6486028f741fecc0523d9ba55d0ae 9 | 10 | COCOAPODS: 0.38.2 11 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - XMLParser (1.0) 3 | 4 | DEPENDENCIES: 5 | - XMLParser (~> 1.0) 6 | 7 | SPEC CHECKSUMS: 8 | XMLParser: e737ced4d8e6486028f741fecc0523d9ba55d0ae 9 | 10 | COCOAPODS: 0.38.2 11 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 11B432AC022AED5B2F9482BB24068E79 /* Tree.swift in Sources */ = {isa = PBXBuildFile; fileRef = 667BF682D43A432CBB7DFE53DC73D459 /* Tree.swift */; }; 11 | 20CFCA2760101AA460E2B6337C04A793 /* XMLCoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = D387D45BDABB245596FBCDAA0859D1EE /* XMLCoder.swift */; }; 12 | 4A9D6A3E778D8727496F800D62F399AA /* String+XMLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE7753E6B0AAED14FA35324AF43C9A8 /* String+XMLParser.swift */; }; 13 | 6AB4BA2F4CA92816FC26EDCB7A780F60 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD498DDAAB757E90472891A93AA7BC5F /* Foundation.framework */; }; 14 | 9421E4C3C1179910CA4509DE1EF2624E /* XMLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FAD84ABD4B4D57A3B4D0D0962642518 /* XMLParser.swift */; }; 15 | 975C6CFFEF5A93054375D98398F0FE02 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD498DDAAB757E90472891A93AA7BC5F /* Foundation.framework */; }; 16 | A4457BA0271DB00C5BFBE23FE70CF8A1 /* XMLParser-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7731FFACB750F14E20F5274F1FE58954 /* XMLParser-dummy.m */; }; 17 | AA74940750532C96CB0CE38860E9CEFB /* XMLDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 071D0D7BB489AABF0042C33827FDE827 /* XMLDecoder.swift */; }; 18 | B45BD769F8FC4C76A5BD9A9657AA8886 /* Dictionary+XMLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81E3D40FFB5024D7BCF6C34FE111A5F /* Dictionary+XMLParser.swift */; }; 19 | C8DD1719A1565E35BFFB48C79346E3BD /* Pods-XMLParser Demo-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B656687A1C7C3E627E4EBFAF33735F5 /* Pods-XMLParser Demo-dummy.m */; }; 20 | D49890614BCBFA0078080FCD8CFF0364 /* XMLParser-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 44FF6D05705F254EBA4FE0C9C83A45A7 /* XMLParser-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 21 | D54778741498427FFA0875FEB5D625F6 /* Pods-XMLParser Demo-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 382F7BB803B575B24EA9266F7737064F /* Pods-XMLParser Demo-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 485D7417A844BA0342DDDF4F5F68A6AE /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 6B45FF906370745138C733A6F65528C2; 30 | remoteInfo = XMLParser; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 071D0D7BB489AABF0042C33827FDE827 /* XMLDecoder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XMLDecoder.swift; path = XMLParser/XMLDecoder.swift; sourceTree = ""; }; 36 | 1A98217B928AD21ADC408BDFA0D89893 /* Pods-XMLParser Demo-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-XMLParser Demo-frameworks.sh"; sourceTree = ""; }; 37 | 1D38D57806160ED2CF02D6C89C5AF8C9 /* XMLParser.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = XMLParser.modulemap; sourceTree = ""; }; 38 | 1DA8C92593521759D3E61A8B15768B9F /* XMLParser.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XMLParser.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 29C4A4BA30B72E220AEE8083A7F2440B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | 2CE218FA4BCCA2F98362AF2746EF42AA /* XMLParser-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "XMLParser-prefix.pch"; sourceTree = ""; }; 41 | 382F7BB803B575B24EA9266F7737064F /* Pods-XMLParser Demo-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-XMLParser Demo-umbrella.h"; sourceTree = ""; }; 42 | 44FF6D05705F254EBA4FE0C9C83A45A7 /* XMLParser-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "XMLParser-umbrella.h"; sourceTree = ""; }; 43 | 4C5148FCA6868832E2A3741C0C49F3CD /* Pods_XMLParser_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_XMLParser_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 4CE7753E6B0AAED14FA35324AF43C9A8 /* String+XMLParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+XMLParser.swift"; path = "XMLParser/String+XMLParser.swift"; sourceTree = ""; }; 45 | 4FAD84ABD4B4D57A3B4D0D0962642518 /* XMLParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XMLParser.swift; path = XMLParser/XMLParser.swift; sourceTree = ""; }; 46 | 667BF682D43A432CBB7DFE53DC73D459 /* Tree.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Tree.swift; path = XMLParser/Tree.swift; sourceTree = ""; }; 47 | 772254087AC39D4E2529A2EC45581A52 /* Pods-XMLParser Demo.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-XMLParser Demo.modulemap"; sourceTree = ""; }; 48 | 7731FFACB750F14E20F5274F1FE58954 /* XMLParser-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "XMLParser-dummy.m"; sourceTree = ""; }; 49 | 79DA132CF5486D274509C406239229FD /* Pods-XMLParser Demo-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-XMLParser Demo-acknowledgements.markdown"; sourceTree = ""; }; 50 | 7B656687A1C7C3E627E4EBFAF33735F5 /* Pods-XMLParser Demo-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-XMLParser Demo-dummy.m"; sourceTree = ""; }; 51 | 8A2647ECED0443742B7A6A41B0385731 /* Pods-XMLParser Demo-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-XMLParser Demo-acknowledgements.plist"; sourceTree = ""; }; 52 | 8C1A6FAD94C4D0364D83DBE3805C0F72 /* Pods-XMLParser Demo-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-XMLParser Demo-resources.sh"; sourceTree = ""; }; 53 | 93BE031836A110DA181AD07BF83AA83B /* Pods-XMLParser Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-XMLParser Demo.debug.xcconfig"; sourceTree = ""; }; 54 | A3D815F103CC6D3A1194B61346BF24ED /* XMLParser-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "XMLParser-Private.xcconfig"; sourceTree = ""; }; 55 | A81E3D40FFB5024D7BCF6C34FE111A5F /* Dictionary+XMLParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Dictionary+XMLParser.swift"; path = "XMLParser/Dictionary+XMLParser.swift"; sourceTree = ""; }; 56 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 57 | BD498DDAAB757E90472891A93AA7BC5F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 58 | CC3F7BA45CBB5E1A4C89CBA1609C1B0D /* Pods-XMLParser Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-XMLParser Demo.release.xcconfig"; sourceTree = ""; }; 59 | D387D45BDABB245596FBCDAA0859D1EE /* XMLCoder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XMLCoder.swift; path = XMLParser/XMLCoder.swift; sourceTree = ""; }; 60 | E87EE846FD62AFF3000668E74474B1C2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | FC4C18866366B2B6A96C22C2BA1B0D97 /* XMLParser.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = XMLParser.xcconfig; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 9BA2B2BEBA2043B84538A4DFA56B632F /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 975C6CFFEF5A93054375D98398F0FE02 /* Foundation.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | F7D3B68C4C17F9088BAC1702B2C84BB0 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 6AB4BA2F4CA92816FC26EDCB7A780F60 /* Foundation.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 435AF724A5DEFA5A1969FA03289A54BE /* Pods-XMLParser Demo */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | E87EE846FD62AFF3000668E74474B1C2 /* Info.plist */, 88 | 772254087AC39D4E2529A2EC45581A52 /* Pods-XMLParser Demo.modulemap */, 89 | 79DA132CF5486D274509C406239229FD /* Pods-XMLParser Demo-acknowledgements.markdown */, 90 | 8A2647ECED0443742B7A6A41B0385731 /* Pods-XMLParser Demo-acknowledgements.plist */, 91 | 7B656687A1C7C3E627E4EBFAF33735F5 /* Pods-XMLParser Demo-dummy.m */, 92 | 1A98217B928AD21ADC408BDFA0D89893 /* Pods-XMLParser Demo-frameworks.sh */, 93 | 8C1A6FAD94C4D0364D83DBE3805C0F72 /* Pods-XMLParser Demo-resources.sh */, 94 | 382F7BB803B575B24EA9266F7737064F /* Pods-XMLParser Demo-umbrella.h */, 95 | 93BE031836A110DA181AD07BF83AA83B /* Pods-XMLParser Demo.debug.xcconfig */, 96 | CC3F7BA45CBB5E1A4C89CBA1609C1B0D /* Pods-XMLParser Demo.release.xcconfig */, 97 | ); 98 | name = "Pods-XMLParser Demo"; 99 | path = "Target Support Files/Pods-XMLParser Demo"; 100 | sourceTree = ""; 101 | }; 102 | 53F661C0CA7190D2CF05023FB33D61E4 /* iOS */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | BD498DDAAB757E90472891A93AA7BC5F /* Foundation.framework */, 106 | ); 107 | name = iOS; 108 | sourceTree = ""; 109 | }; 110 | 5434982328C34779A2948CAD7DF7891F /* Targets Support Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 435AF724A5DEFA5A1969FA03289A54BE /* Pods-XMLParser Demo */, 114 | ); 115 | name = "Targets Support Files"; 116 | sourceTree = ""; 117 | }; 118 | 5DEDB34DD213F0971A5FCE94BEF47312 /* Pods */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | B2A0D02CC4E9DC3B8C7AB2AED876ACFF /* XMLParser */, 122 | ); 123 | name = Pods; 124 | sourceTree = ""; 125 | }; 126 | 7DB346D0F39D3F0E887471402A8071AB = { 127 | isa = PBXGroup; 128 | children = ( 129 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, 130 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, 131 | 5DEDB34DD213F0971A5FCE94BEF47312 /* Pods */, 132 | CCA510CFBEA2D207524CDA0D73C3B561 /* Products */, 133 | 5434982328C34779A2948CAD7DF7891F /* Targets Support Files */, 134 | ); 135 | sourceTree = ""; 136 | }; 137 | 8FCF89CDF5BD8ACACABE3A22C38E9FD2 /* Support Files */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 29C4A4BA30B72E220AEE8083A7F2440B /* Info.plist */, 141 | 1D38D57806160ED2CF02D6C89C5AF8C9 /* XMLParser.modulemap */, 142 | FC4C18866366B2B6A96C22C2BA1B0D97 /* XMLParser.xcconfig */, 143 | A3D815F103CC6D3A1194B61346BF24ED /* XMLParser-Private.xcconfig */, 144 | 7731FFACB750F14E20F5274F1FE58954 /* XMLParser-dummy.m */, 145 | 2CE218FA4BCCA2F98362AF2746EF42AA /* XMLParser-prefix.pch */, 146 | 44FF6D05705F254EBA4FE0C9C83A45A7 /* XMLParser-umbrella.h */, 147 | ); 148 | name = "Support Files"; 149 | path = "../Target Support Files/XMLParser"; 150 | sourceTree = ""; 151 | }; 152 | B2A0D02CC4E9DC3B8C7AB2AED876ACFF /* XMLParser */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | A81E3D40FFB5024D7BCF6C34FE111A5F /* Dictionary+XMLParser.swift */, 156 | 4CE7753E6B0AAED14FA35324AF43C9A8 /* String+XMLParser.swift */, 157 | 667BF682D43A432CBB7DFE53DC73D459 /* Tree.swift */, 158 | D387D45BDABB245596FBCDAA0859D1EE /* XMLCoder.swift */, 159 | 071D0D7BB489AABF0042C33827FDE827 /* XMLDecoder.swift */, 160 | 4FAD84ABD4B4D57A3B4D0D0962642518 /* XMLParser.swift */, 161 | 8FCF89CDF5BD8ACACABE3A22C38E9FD2 /* Support Files */, 162 | ); 163 | path = XMLParser; 164 | sourceTree = ""; 165 | }; 166 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 53F661C0CA7190D2CF05023FB33D61E4 /* iOS */, 170 | ); 171 | name = Frameworks; 172 | sourceTree = ""; 173 | }; 174 | CCA510CFBEA2D207524CDA0D73C3B561 /* Products */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 4C5148FCA6868832E2A3741C0C49F3CD /* Pods_XMLParser_Demo.framework */, 178 | 1DA8C92593521759D3E61A8B15768B9F /* XMLParser.framework */, 179 | ); 180 | name = Products; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXHeadersBuildPhase section */ 186 | 524685FA67FB9AAA46F8383E13AA317F /* Headers */ = { 187 | isa = PBXHeadersBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | D54778741498427FFA0875FEB5D625F6 /* Pods-XMLParser Demo-umbrella.h in Headers */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | 98B681DA463B824A7F6100EF09CA2EC7 /* Headers */ = { 195 | isa = PBXHeadersBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | D49890614BCBFA0078080FCD8CFF0364 /* XMLParser-umbrella.h in Headers */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXHeadersBuildPhase section */ 203 | 204 | /* Begin PBXNativeTarget section */ 205 | 263D10453D5E463DA38236D3DFB6BF76 /* Pods-XMLParser Demo */ = { 206 | isa = PBXNativeTarget; 207 | buildConfigurationList = 2B049A05C6431EB60BD4F8F6E55AFDF3 /* Build configuration list for PBXNativeTarget "Pods-XMLParser Demo" */; 208 | buildPhases = ( 209 | 89D8F8FDDBA4115489DC5EA704A6FE72 /* Sources */, 210 | F7D3B68C4C17F9088BAC1702B2C84BB0 /* Frameworks */, 211 | 524685FA67FB9AAA46F8383E13AA317F /* Headers */, 212 | ); 213 | buildRules = ( 214 | ); 215 | dependencies = ( 216 | CAEC87A4A48876EB923841E7EE65ED43 /* PBXTargetDependency */, 217 | ); 218 | name = "Pods-XMLParser Demo"; 219 | productName = "Pods-XMLParser Demo"; 220 | productReference = 4C5148FCA6868832E2A3741C0C49F3CD /* Pods_XMLParser_Demo.framework */; 221 | productType = "com.apple.product-type.framework"; 222 | }; 223 | 6B45FF906370745138C733A6F65528C2 /* XMLParser */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = 4F3B17EEB2A401E70BCE68619BDD9790 /* Build configuration list for PBXNativeTarget "XMLParser" */; 226 | buildPhases = ( 227 | 9EA0DC3DF0A50B287EA726D29C0A33CE /* Sources */, 228 | 9BA2B2BEBA2043B84538A4DFA56B632F /* Frameworks */, 229 | 98B681DA463B824A7F6100EF09CA2EC7 /* Headers */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | ); 235 | name = XMLParser; 236 | productName = XMLParser; 237 | productReference = 1DA8C92593521759D3E61A8B15768B9F /* XMLParser.framework */; 238 | productType = "com.apple.product-type.framework"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | LastSwiftUpdateCheck = 0700; 247 | LastUpgradeCheck = 0700; 248 | }; 249 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 250 | compatibilityVersion = "Xcode 3.2"; 251 | developmentRegion = English; 252 | hasScannedForEncodings = 0; 253 | knownRegions = ( 254 | en, 255 | ); 256 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 257 | productRefGroup = CCA510CFBEA2D207524CDA0D73C3B561 /* Products */; 258 | projectDirPath = ""; 259 | projectRoot = ""; 260 | targets = ( 261 | 263D10453D5E463DA38236D3DFB6BF76 /* Pods-XMLParser Demo */, 262 | 6B45FF906370745138C733A6F65528C2 /* XMLParser */, 263 | ); 264 | }; 265 | /* End PBXProject section */ 266 | 267 | /* Begin PBXSourcesBuildPhase section */ 268 | 89D8F8FDDBA4115489DC5EA704A6FE72 /* Sources */ = { 269 | isa = PBXSourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | C8DD1719A1565E35BFFB48C79346E3BD /* Pods-XMLParser Demo-dummy.m in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | 9EA0DC3DF0A50B287EA726D29C0A33CE /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | B45BD769F8FC4C76A5BD9A9657AA8886 /* Dictionary+XMLParser.swift in Sources */, 281 | 4A9D6A3E778D8727496F800D62F399AA /* String+XMLParser.swift in Sources */, 282 | 11B432AC022AED5B2F9482BB24068E79 /* Tree.swift in Sources */, 283 | 20CFCA2760101AA460E2B6337C04A793 /* XMLCoder.swift in Sources */, 284 | AA74940750532C96CB0CE38860E9CEFB /* XMLDecoder.swift in Sources */, 285 | A4457BA0271DB00C5BFBE23FE70CF8A1 /* XMLParser-dummy.m in Sources */, 286 | 9421E4C3C1179910CA4509DE1EF2624E /* XMLParser.swift in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | /* End PBXSourcesBuildPhase section */ 291 | 292 | /* Begin PBXTargetDependency section */ 293 | CAEC87A4A48876EB923841E7EE65ED43 /* PBXTargetDependency */ = { 294 | isa = PBXTargetDependency; 295 | name = XMLParser; 296 | target = 6B45FF906370745138C733A6F65528C2 /* XMLParser */; 297 | targetProxy = 485D7417A844BA0342DDDF4F5F68A6AE /* PBXContainerItemProxy */; 298 | }; 299 | /* End PBXTargetDependency section */ 300 | 301 | /* Begin XCBuildConfiguration section */ 302 | 0F4BA840F2B855A6EC8CD2D12AB992AE /* Release */ = { 303 | isa = XCBuildConfiguration; 304 | baseConfigurationReference = CC3F7BA45CBB5E1A4C89CBA1609C1B0D /* Pods-XMLParser Demo.release.xcconfig */; 305 | buildSettings = { 306 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 307 | CURRENT_PROJECT_VERSION = 1; 308 | DEFINES_MODULE = YES; 309 | DYLIB_COMPATIBILITY_VERSION = 1; 310 | DYLIB_CURRENT_VERSION = 1; 311 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | INFOPLIST_FILE = "Target Support Files/Pods-XMLParser Demo/Info.plist"; 314 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 315 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 316 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 317 | MODULEMAP_FILE = "Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.modulemap"; 318 | MTL_ENABLE_DEBUG_INFO = NO; 319 | OTHER_LDFLAGS = ""; 320 | OTHER_LIBTOOLFLAGS = ""; 321 | PODS_ROOT = "$(SRCROOT)"; 322 | PRODUCT_NAME = Pods_XMLParser_Demo; 323 | SDKROOT = iphoneos; 324 | SKIP_INSTALL = YES; 325 | TARGETED_DEVICE_FAMILY = "1,2"; 326 | VERSIONING_SYSTEM = "apple-generic"; 327 | VERSION_INFO_PREFIX = ""; 328 | }; 329 | name = Release; 330 | }; 331 | 26F28D28F7167439E4DE6447710E772A /* Release */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = A3D815F103CC6D3A1194B61346BF24ED /* XMLParser-Private.xcconfig */; 334 | buildSettings = { 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | CURRENT_PROJECT_VERSION = 1.0.0; 337 | DEFINES_MODULE = YES; 338 | DYLIB_COMPATIBILITY_VERSION = 1; 339 | DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; 340 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | GCC_PREFIX_HEADER = "Target Support Files/XMLParser/XMLParser-prefix.pch"; 343 | INFOPLIST_FILE = "Target Support Files/XMLParser/Info.plist"; 344 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 345 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 347 | MODULEMAP_FILE = "Target Support Files/XMLParser/XMLParser.modulemap"; 348 | MTL_ENABLE_DEBUG_INFO = NO; 349 | PRODUCT_NAME = XMLParser; 350 | SDKROOT = iphoneos; 351 | SKIP_INSTALL = YES; 352 | TARGETED_DEVICE_FAMILY = "1,2"; 353 | VERSIONING_SYSTEM = "apple-generic"; 354 | VERSION_INFO_PREFIX = ""; 355 | }; 356 | name = Release; 357 | }; 358 | 67BCF509F66CC519201881338E278D72 /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | baseConfigurationReference = 93BE031836A110DA181AD07BF83AA83B /* Pods-XMLParser Demo.debug.xcconfig */; 361 | buildSettings = { 362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 363 | CURRENT_PROJECT_VERSION = 1; 364 | DEFINES_MODULE = YES; 365 | DYLIB_COMPATIBILITY_VERSION = 1; 366 | DYLIB_CURRENT_VERSION = 1; 367 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 368 | ENABLE_STRICT_OBJC_MSGSEND = YES; 369 | INFOPLIST_FILE = "Target Support Files/Pods-XMLParser Demo/Info.plist"; 370 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 371 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 372 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 373 | MODULEMAP_FILE = "Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.modulemap"; 374 | MTL_ENABLE_DEBUG_INFO = YES; 375 | OTHER_LDFLAGS = ""; 376 | OTHER_LIBTOOLFLAGS = ""; 377 | PODS_ROOT = "$(SRCROOT)"; 378 | PRODUCT_NAME = Pods_XMLParser_Demo; 379 | SDKROOT = iphoneos; 380 | SKIP_INSTALL = YES; 381 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | VERSIONING_SYSTEM = "apple-generic"; 384 | VERSION_INFO_PREFIX = ""; 385 | }; 386 | name = Debug; 387 | }; 388 | 6D11574BE9FC003E7CB21345D69C3723 /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = A3D815F103CC6D3A1194B61346BF24ED /* XMLParser-Private.xcconfig */; 391 | buildSettings = { 392 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 393 | CURRENT_PROJECT_VERSION = 1.0.0; 394 | DEFINES_MODULE = YES; 395 | DYLIB_COMPATIBILITY_VERSION = 1; 396 | DYLIB_CURRENT_VERSION = "$(CURRENT_PROJECT_VERSION)"; 397 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 398 | ENABLE_STRICT_OBJC_MSGSEND = YES; 399 | GCC_PREFIX_HEADER = "Target Support Files/XMLParser/XMLParser-prefix.pch"; 400 | INFOPLIST_FILE = "Target Support Files/XMLParser/Info.plist"; 401 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 402 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 404 | MODULEMAP_FILE = "Target Support Files/XMLParser/XMLParser.modulemap"; 405 | MTL_ENABLE_DEBUG_INFO = YES; 406 | PRODUCT_NAME = XMLParser; 407 | SDKROOT = iphoneos; 408 | SKIP_INSTALL = YES; 409 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 410 | TARGETED_DEVICE_FAMILY = "1,2"; 411 | VERSIONING_SYSTEM = "apple-generic"; 412 | VERSION_INFO_PREFIX = ""; 413 | }; 414 | name = Debug; 415 | }; 416 | A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | ALWAYS_SEARCH_USER_PATHS = NO; 420 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 421 | CLANG_CXX_LIBRARY = "libc++"; 422 | CLANG_ENABLE_MODULES = YES; 423 | CLANG_ENABLE_OBJC_ARC = YES; 424 | CLANG_WARN_BOOL_CONVERSION = YES; 425 | CLANG_WARN_CONSTANT_CONVERSION = YES; 426 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 427 | CLANG_WARN_EMPTY_BODY = YES; 428 | CLANG_WARN_ENUM_CONVERSION = YES; 429 | CLANG_WARN_INT_CONVERSION = YES; 430 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 431 | CLANG_WARN_UNREACHABLE_CODE = YES; 432 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 433 | COPY_PHASE_STRIP = NO; 434 | GCC_C_LANGUAGE_STANDARD = gnu99; 435 | GCC_DYNAMIC_NO_PIC = NO; 436 | GCC_OPTIMIZATION_LEVEL = 0; 437 | GCC_PREPROCESSOR_DEFINITIONS = ( 438 | "DEBUG=1", 439 | "$(inherited)", 440 | ); 441 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 442 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 443 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 444 | GCC_WARN_UNDECLARED_SELECTOR = YES; 445 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 446 | GCC_WARN_UNUSED_FUNCTION = YES; 447 | GCC_WARN_UNUSED_VARIABLE = YES; 448 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 449 | ONLY_ACTIVE_ARCH = YES; 450 | STRIP_INSTALLED_PRODUCT = NO; 451 | SYMROOT = "${SRCROOT}/../build"; 452 | }; 453 | name = Debug; 454 | }; 455 | FB45FFD90572718D82AB9092B750F0CA /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | ALWAYS_SEARCH_USER_PATHS = NO; 459 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 460 | CLANG_CXX_LIBRARY = "libc++"; 461 | CLANG_ENABLE_MODULES = YES; 462 | CLANG_ENABLE_OBJC_ARC = YES; 463 | CLANG_WARN_BOOL_CONVERSION = YES; 464 | CLANG_WARN_CONSTANT_CONVERSION = YES; 465 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 466 | CLANG_WARN_EMPTY_BODY = YES; 467 | CLANG_WARN_ENUM_CONVERSION = YES; 468 | CLANG_WARN_INT_CONVERSION = YES; 469 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 470 | CLANG_WARN_UNREACHABLE_CODE = YES; 471 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 472 | COPY_PHASE_STRIP = YES; 473 | ENABLE_NS_ASSERTIONS = NO; 474 | GCC_C_LANGUAGE_STANDARD = gnu99; 475 | GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; 476 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 477 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 478 | GCC_WARN_UNDECLARED_SELECTOR = YES; 479 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 480 | GCC_WARN_UNUSED_FUNCTION = YES; 481 | GCC_WARN_UNUSED_VARIABLE = YES; 482 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 483 | STRIP_INSTALLED_PRODUCT = NO; 484 | SYMROOT = "${SRCROOT}/../build"; 485 | VALIDATE_PRODUCT = YES; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | 2B049A05C6431EB60BD4F8F6E55AFDF3 /* Build configuration list for PBXNativeTarget "Pods-XMLParser Demo" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 67BCF509F66CC519201881338E278D72 /* Debug */, 496 | 0F4BA840F2B855A6EC8CD2D12AB992AE /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */, 505 | FB45FFD90572718D82AB9092B750F0CA /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | 4F3B17EEB2A401E70BCE68619BDD9790 /* Build configuration list for PBXNativeTarget "XMLParser" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | 6D11574BE9FC003E7CB21345D69C3723 /* Debug */, 514 | 26F28D28F7167439E4DE6447710E772A /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | /* End XCConfigurationList section */ 520 | }; 521 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 522 | } 523 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## XMLParser 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2015 Eugene Mozharovsky 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | Generated by CocoaPods - http://cocoapods.org 30 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2015 Eugene Mozharovsky 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | 40 | Title 41 | XMLParser 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - http://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XMLParser_Demo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XMLParser_Demo 5 | @end 6 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | else 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | fi 16 | 17 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | 19 | if [ -L "${source}" ]; then 20 | echo "Symlinked..." 21 | source="$(readlink "${source}")" 22 | fi 23 | 24 | # use filter instead of exclude so missing patterns dont' throw errors 25 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 26 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 27 | 28 | # Resign the code if required by the build settings to avoid unstable apps 29 | code_sign_if_enabled "${destination}/$(basename "$1")" 30 | 31 | # Embed linked Swift runtime libraries 32 | local basename 33 | basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})" 34 | local swift_runtime_libs 35 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 36 | for lib in $swift_runtime_libs; do 37 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 38 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 39 | code_sign_if_enabled "${destination}/${lib}" 40 | done 41 | } 42 | 43 | # Signs a framework with the provided identity 44 | code_sign_if_enabled() { 45 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 46 | # Use the current code_sign_identitiy 47 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 48 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 49 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 50 | fi 51 | } 52 | 53 | 54 | if [[ "$CONFIGURATION" == "Debug" ]]; then 55 | install_framework 'Pods-XMLParser Demo/XMLParser.framework' 56 | fi 57 | if [[ "$CONFIGURATION" == "Release" ]]; then 58 | install_framework 'Pods-XMLParser Demo/XMLParser.framework' 59 | fi 60 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_XMLParser_DemoVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_XMLParser_DemoVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/XMLParser.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "XMLParser" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-XMLParser Demo 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_XMLParser_Demo { 2 | umbrella header "Pods-XMLParser Demo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/XMLParser.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "XMLParser" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-XMLParser Demo 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "XMLParser.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/XMLParser" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_XMLParser : NSObject 3 | @end 4 | @implementation PodsDummy_XMLParser 5 | @end 6 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double XMLParserVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char XMLParserVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser.modulemap: -------------------------------------------------------------------------------- 1 | framework module XMLParser { 2 | umbrella header "XMLParser-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mozharovsky/XMLParser/062bb7fb8425c0151704421e348fa5707d4fb4a6/XMLParser Demo/Pods/Target Support Files/XMLParser/XMLParser.xcconfig -------------------------------------------------------------------------------- /XMLParser Demo/Pods/XMLParser/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Eugene Mozharovsky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/XMLParser/XMLParser/Dictionary+XMLParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dictionary+XMLParser.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A convenience extension for assembling tries from 12 | /// a dictionary with values (XML representation). 13 | public extension Dictionary { 14 | 15 | // MARK: - Initialization 16 | 17 | /// Merges current dictionary with a given dictionary. 18 | public mutating func merge(sequence: S) { 19 | for (key, value) in sequence { 20 | self[key] = value 21 | } 22 | } 23 | 24 | /// An initializer for merging two dictionaries. 25 | public init(sequence: S) { 26 | self.init() 27 | merge(sequence) 28 | } 29 | 30 | /// An initializer for merging current dictionary and pairs ([Key, Value]). 31 | public init(pairs: [(Key, Value)]) { 32 | self.init() 33 | merge(pairs) 34 | } 35 | 36 | /// Creates pairs (Key,Value) from the dictionary. 37 | private func pairs(var tree: [Dictionary] = [[:]]) -> (keys: [Key], values: [Value]) { 38 | if tree.isEmpty { 39 | tree = dictionariesTree() 40 | } 41 | 42 | var keys: Set = [] 43 | var values: [Value] = [] 44 | 45 | for dict in tree { 46 | for (key, value) in dict { 47 | keys.insert(key) 48 | 49 | if !collection(values, hasElement: value) { 50 | values += [value] 51 | } 52 | } 53 | } 54 | 55 | return (keys.map { $0 }, values) 56 | } 57 | 58 | /// Converts an NSDictionary into a pure Swift Dictionary with generic 59 | /// Key, Value pair. 60 | public static func convertedDictionary(dictionary: NSDictionary) -> Dictionary { 61 | var dict = Dictionary() 62 | for (key, value) in dictionary { 63 | if let key = key as? K, value = value as? V { 64 | dict[key] = value 65 | } 66 | } 67 | 68 | return dict 69 | } 70 | 71 | /// An initializer for creating a pure Swift Dictionary 72 | /// from Cocoa NSDictionary analogue. 73 | public init(dictionary: NSDictionary) { 74 | let pairs = dictionary.map { ($0.key as? Key, $0.value as? Value) } 75 | let prepared = pairs.filter { ($0.0 != nil && $0.1 != nil) } 76 | self.init(pairs: prepared as! [(Key, Value)]) 77 | } 78 | 79 | /// Returns a Cocoa NSDictionary from the pure Swift Dictionary. 80 | public func standardDictionary() -> NSDictionary { 81 | let dict = NSMutableDictionary() 82 | for (k, v) in self { 83 | if let key = k as? NSCopying, value = v as? AnyObject { 84 | dict[key] = value 85 | } 86 | } 87 | 88 | return dict 89 | } 90 | 91 | // MARK: - Assembling tries 92 | 93 | /// Assembles a general tree for the given dictionary. 94 | public func dictionariesTree() -> [Dictionary] { 95 | var collections: Set = [] 96 | collections.insert(self.standardDictionary()) 97 | 98 | func iterate(dictionary: Dictionary) { 99 | for (_, value) in dictionary { 100 | if let dict = value as? NSDictionary where !collections.contains(dict) { 101 | collections.insert(dict) 102 | iterate(Dictionary.convertedDictionary(dict) as Dictionary) 103 | } 104 | } 105 | } 106 | 107 | iterate(Dictionary.convertedDictionary(self.standardDictionary()) as Dictionary) 108 | 109 | return collections.map { Dictionary(dictionary: $0) } 110 | } 111 | 112 | /// Determines if an array with this dictionary's values contains one. 113 | private func collection(values: [Value], hasElement value: Value) -> Bool { 114 | let contains = values.contains { (element: Value) in 115 | return self.value(value, equalToValue: element) 116 | } 117 | 118 | return contains 119 | } 120 | 121 | /// Equatable analogue. 122 | private func value(value: Value, equalToValue other: Value) -> Bool { 123 | if let value = value as? NSNumber, other = other as? NSNumber { 124 | return value == other 125 | } else if let value = value as? NSValue, other = other as? NSValue { 126 | return value == other 127 | } 128 | 129 | return false 130 | } 131 | 132 | // TODO: Fix for parsing arrays as well 133 | 134 | /// Create an array of tries (for high level tags). 135 | public func generateTries() -> [Tree]? { 136 | var collections: Set = [] 137 | var chains: [Tree] = [] 138 | 139 | collections.insert(self.standardDictionary()) 140 | 141 | func iterate(dictionary: Dictionary, lastChain: Tree?) { 142 | for (key, value) in dictionary { 143 | let chain = Tree(previous: lastChain, node: ("\(key)", "\(value)"), next: nil) 144 | chains += [chain] 145 | 146 | if let lastChain = lastChain { 147 | if lastChain.next == nil { 148 | lastChain.next = [] 149 | } 150 | 151 | lastChain.next! += [chain] 152 | } 153 | 154 | if let dict = value as? NSDictionary where !collections.contains(dict) { 155 | collections.insert(dict) 156 | iterate(Dictionary.convertedDictionary(dict) as Dictionary, lastChain: chain) 157 | } 158 | } 159 | } 160 | 161 | iterate(Dictionary.convertedDictionary(self.standardDictionary()) as Dictionary, lastChain: nil) 162 | 163 | chains = chains.filter { $0.first() == $0 } 164 | 165 | return chains 166 | } 167 | } -------------------------------------------------------------------------------- /XMLParser Demo/Pods/XMLParser/XMLParser/String+XMLParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+XMLParser.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A convenience extension for parsing a string into an XML structure. 12 | public extension String { 13 | /// XML begin tag (e.g. ``). 14 | public func startHeader() -> String { 15 | if !hasPrefix("<") && !hasSuffix(">") { 16 | return "<\(self)>" 17 | } 18 | 19 | return self 20 | } 21 | 22 | /// XML end tag (e.g. ``). 23 | public func endHeader() -> String { 24 | if !hasPrefix("<") && !hasSuffix(">") { 25 | return "" 26 | } 27 | 28 | return self 29 | } 30 | 31 | /// XML tag value (e.g. from `` the result is 'request'). 32 | public func original() -> String { 33 | var start = startIndex 34 | var end = endIndex 35 | 36 | if hasPrefix("<") { 37 | start++ 38 | 39 | if self[start..") { 46 | end-- 47 | } 48 | 49 | return self[start.. { 13 | 14 | // MARK: - Properties 15 | 16 | /// The previous tree if any. It should be weak since it's an optional 17 | /// and besides we don't want to face cycled referencing. 18 | public weak var previous: Tree? 19 | 20 | /// Self node with values *name* and *value*. 21 | public let node: (name: String, value: T) 22 | 23 | /// The next tree if any. 24 | public var next: [Tree]? 25 | 26 | /// Defines the indentation level. 27 | private let multiplier = 3 28 | 29 | /// A tmp counter for steps. 30 | private lazy var _steps = 0 31 | 32 | /// Steps for reaching the very first tree. 33 | public var steps: Int { 34 | get { 35 | if let previous = previous { 36 | previous._steps = ++_steps 37 | return previous.steps 38 | } else { 39 | let copy = self._steps 40 | self._steps = 0 41 | return copy 42 | } 43 | } 44 | 45 | } 46 | 47 | // MARK: - Initialization 48 | 49 | /// A general initializer. 50 | public init(previous: Tree?, node: (String, T), next: [Tree]?) { 51 | self.previous = previous 52 | self.node = node 53 | self.next = next 54 | } 55 | 56 | // MARK: - Convenience stuff 57 | 58 | public convenience init(node: (String, T)) { 59 | self.init(previous: nil, node: node, next: nil) 60 | } 61 | 62 | public convenience init(previous: Tree, node: (String, T)) { 63 | self.init(previous: previous, node: node, next: nil) 64 | } 65 | 66 | public convenience init(node: (String, T), next: [Tree]) { 67 | self.init(previous: nil, node: node, next: next) 68 | } 69 | 70 | // MARK: - Utils 71 | 72 | /// Returns the very first tree. 73 | public func first() -> Tree { 74 | if let previous = previous { 75 | return previous.first() 76 | } else { 77 | return self 78 | } 79 | } 80 | } 81 | 82 | // MARK: - Parsing utils 83 | 84 | extension Tree { 85 | /// A util function that parsed the current tree structure into 86 | /// an XML string. 87 | public func parsedRequestBody() -> String { 88 | var body = "" 89 | 90 | func spaces(count: Int) -> String { 91 | var string = "" 92 | for _ in 0..) { 100 | let spaces = spaces(tree.steps * multiplier) 101 | 102 | if body.characters.count > 0 && body.characters.last != "\n" { 103 | body += "\n" 104 | } 105 | 106 | body += spaces 107 | body += tree.node.name.startHeader() 108 | 109 | 110 | if tree.next == nil || tree.next?.count == 0 { 111 | body += "\(tree.node.value)" 112 | } 113 | 114 | if let tries = tree.next { 115 | for tree in tries { 116 | process(tree) 117 | } 118 | } 119 | 120 | if body.characters.last == "\n" { 121 | body += spaces 122 | } 123 | 124 | body += tree.node.name.endHeader() 125 | body += "\n" 126 | } 127 | 128 | process(self) 129 | 130 | return body 131 | 132 | } 133 | } 134 | 135 | // MARK: - Equatable 136 | 137 | public func ==(lhs: Tree, rhs: Tree) -> Bool { 138 | return lhs === rhs 139 | } 140 | -------------------------------------------------------------------------------- /XMLParser Demo/Pods/XMLParser/XMLParser/XMLCoder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLCoder.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A protocol for encoding a dictionary with values into an XML string. 12 | public protocol XMLCoder { 13 | /// Encodes a dictionary into an XML string. 14 | /// - parameter data: A generic dictionary. Generally, the **Key** should be hashable and 15 | /// in most of cases it must be a **String**. The value 16 | /// might vary. 17 | /// - parameter header: A header for the XML string. 18 | /// - returns: A converted XML string. 19 | func encode(data: Dictionary, header: String) -> String 20 | } -------------------------------------------------------------------------------- /XMLParser Demo/Pods/XMLParser/XMLParser/XMLDecoder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLDecoder.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A protocol for decoding an input value into an output array. 12 | public protocol XMLDecoder { 13 | typealias Input 14 | typealias Output 15 | 16 | /// Decodes the given input into the specified output. 17 | /// - parameter data: An input data, it is defined as a generic 18 | /// type but in fact you must provide a **String** input. 19 | /// - returns: A defined output, should be an array of values. 20 | func decode(data: Input) -> Output 21 | } -------------------------------------------------------------------------------- /XMLParser Demo/Pods/XMLParser/XMLParser/XMLParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLParser.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A parser class supposed to provide features for (de)coding 12 | /// data into XML and vice versa. 13 | /// The class provides a singleton. 14 | public class XMLParser: XMLCoder, XMLDecoder { 15 | /// A singleton accessor. 16 | public static let sharedParser = XMLParser() 17 | 18 | // MARK: - XMLCoder & XMLDecoder 19 | 20 | public func encode(data: Dictionary, header: String = "") -> String { 21 | guard let tries = data.generateTries() else { 22 | return "" 23 | } 24 | 25 | return header + tries.map { $0.parsedRequestBody() }.reduce("", combine: +) 26 | } 27 | 28 | public func decode(data: String) -> Dictionary { 29 | return findTags(data) 30 | } 31 | 32 | // MARK: - Initialization 33 | 34 | /// A private initializer for singleton implementation. 35 | private init() { } 36 | 37 | // MARK: - Utils 38 | 39 | /// Finds XML tags in a given string (supposed to be previously parsed into XML format). 40 | /// - parameter body: A given XML parsed string. 41 | /// - returns: A dictionary with arrays of values. 42 | private func findTags(body: String) -> [String : [String]] { 43 | var keys: [String] = [] 44 | 45 | var write = false 46 | var char = "" 47 | var value = "" 48 | var values: [String : [String]] = [:] 49 | 50 | for ch in body.characters { 51 | if ch == "<" { 52 | write = true 53 | } else if ch == ">" { 54 | write = false 55 | } 56 | 57 | if ch == "\n" { 58 | continue 59 | } 60 | 61 | if write { 62 | if let last = keys.last where value != "" { 63 | if let _ = values[last.original()] { 64 | values[last.original()]! += [value] 65 | } else { 66 | values[last.original()] = [] 67 | values[last.original()]! += [value] 68 | } 69 | value = "" 70 | } 71 | 72 | char += String(ch) 73 | } else { 74 | if char != "" { 75 | char += String(ch) 76 | keys += [char] 77 | char = "" 78 | } else if let last = keys.last where last == last.original().startHeader() { 79 | if ch == " " && (value.characters.last == " " || value.characters.last == "\n" || value.characters.count == 0) { 80 | continue 81 | } 82 | 83 | value += String(ch) 84 | } 85 | } 86 | } 87 | 88 | return values 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8F5CDEB11B9249A200C6672C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F5CDEB01B9249A200C6672C /* AppDelegate.swift */; }; 11 | 8F5CDEB31B9249A200C6672C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F5CDEB21B9249A200C6672C /* ViewController.swift */; }; 12 | 8F5CDEB61B9249A200C6672C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F5CDEB41B9249A200C6672C /* Main.storyboard */; }; 13 | 8F5CDEB81B9249A200C6672C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F5CDEB71B9249A200C6672C /* Assets.xcassets */; }; 14 | 8F5CDEBB1B9249A200C6672C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F5CDEB91B9249A200C6672C /* LaunchScreen.storyboard */; }; 15 | 8F5CDEC61B9249A200C6672C /* XMLParser_DemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F5CDEC51B9249A200C6672C /* XMLParser_DemoTests.swift */; }; 16 | A5CF45BCFD319019B17D8966 /* Pods_XMLParser_Demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44E021F5F9EF50089C7E58C2 /* Pods_XMLParser_Demo.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 8F5CDEC21B9249A200C6672C /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 8F5CDEA51B9249A200C6672C /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 8F5CDEAC1B9249A200C6672C; 25 | remoteInfo = "XMLParser Demo"; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 44E021F5F9EF50089C7E58C2 /* Pods_XMLParser_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_XMLParser_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 7FFA3F7E4F8B2CBB04B9137D /* Pods-XMLParser Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XMLParser Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.release.xcconfig"; sourceTree = ""; }; 32 | 8F5CDEAD1B9249A200C6672C /* XMLParser Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "XMLParser Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 8F5CDEB01B9249A200C6672C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 34 | 8F5CDEB21B9249A200C6672C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 35 | 8F5CDEB51B9249A200C6672C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 36 | 8F5CDEB71B9249A200C6672C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 37 | 8F5CDEBA1B9249A200C6672C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 38 | 8F5CDEBC1B9249A200C6672C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 8F5CDEC11B9249A200C6672C /* XMLParser DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "XMLParser DemoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 8F5CDEC51B9249A200C6672C /* XMLParser_DemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XMLParser_DemoTests.swift; sourceTree = ""; }; 41 | 8F5CDEC71B9249A200C6672C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | FCC9F207E41628FDBFDBC46A /* Pods-XMLParser Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XMLParser Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo.debug.xcconfig"; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 8F5CDEAA1B9249A200C6672C /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | A5CF45BCFD319019B17D8966 /* Pods_XMLParser_Demo.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | 8F5CDEBE1B9249A200C6672C /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 17E988B1500A48DF22CAF8D0 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | FCC9F207E41628FDBFDBC46A /* Pods-XMLParser Demo.debug.xcconfig */, 68 | 7FFA3F7E4F8B2CBB04B9137D /* Pods-XMLParser Demo.release.xcconfig */, 69 | ); 70 | name = Pods; 71 | sourceTree = ""; 72 | }; 73 | 6E38920B17524DA723674DAE /* Frameworks */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 44E021F5F9EF50089C7E58C2 /* Pods_XMLParser_Demo.framework */, 77 | ); 78 | name = Frameworks; 79 | sourceTree = ""; 80 | }; 81 | 8F5CDEA41B9249A200C6672C = { 82 | isa = PBXGroup; 83 | children = ( 84 | 8F5CDEAF1B9249A200C6672C /* XMLParser Demo */, 85 | 8F5CDEC41B9249A200C6672C /* XMLParser DemoTests */, 86 | 8F5CDEAE1B9249A200C6672C /* Products */, 87 | 17E988B1500A48DF22CAF8D0 /* Pods */, 88 | 6E38920B17524DA723674DAE /* Frameworks */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 8F5CDEAE1B9249A200C6672C /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 8F5CDEAD1B9249A200C6672C /* XMLParser Demo.app */, 96 | 8F5CDEC11B9249A200C6672C /* XMLParser DemoTests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 8F5CDEAF1B9249A200C6672C /* XMLParser Demo */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 8F5CDEB01B9249A200C6672C /* AppDelegate.swift */, 105 | 8F5CDEB21B9249A200C6672C /* ViewController.swift */, 106 | 8F5CDEB41B9249A200C6672C /* Main.storyboard */, 107 | 8F5CDEB71B9249A200C6672C /* Assets.xcassets */, 108 | 8F5CDEB91B9249A200C6672C /* LaunchScreen.storyboard */, 109 | 8F5CDEBC1B9249A200C6672C /* Info.plist */, 110 | ); 111 | path = "XMLParser Demo"; 112 | sourceTree = ""; 113 | }; 114 | 8F5CDEC41B9249A200C6672C /* XMLParser DemoTests */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 8F5CDEC51B9249A200C6672C /* XMLParser_DemoTests.swift */, 118 | 8F5CDEC71B9249A200C6672C /* Info.plist */, 119 | ); 120 | path = "XMLParser DemoTests"; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | 8F5CDEAC1B9249A200C6672C /* XMLParser Demo */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = 8F5CDECA1B9249A200C6672C /* Build configuration list for PBXNativeTarget "XMLParser Demo" */; 129 | buildPhases = ( 130 | 1785C9C39618AAD7A38C1BEB /* Check Pods Manifest.lock */, 131 | 8F5CDEA91B9249A200C6672C /* Sources */, 132 | 8F5CDEAA1B9249A200C6672C /* Frameworks */, 133 | 8F5CDEAB1B9249A200C6672C /* Resources */, 134 | C82AB3B538C8B6026FD4B796 /* Embed Pods Frameworks */, 135 | F47E1E10086535560C6249F5 /* Copy Pods Resources */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = "XMLParser Demo"; 142 | productName = "XMLParser Demo"; 143 | productReference = 8F5CDEAD1B9249A200C6672C /* XMLParser Demo.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | 8F5CDEC01B9249A200C6672C /* XMLParser DemoTests */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = 8F5CDECD1B9249A200C6672C /* Build configuration list for PBXNativeTarget "XMLParser DemoTests" */; 149 | buildPhases = ( 150 | 8F5CDEBD1B9249A200C6672C /* Sources */, 151 | 8F5CDEBE1B9249A200C6672C /* Frameworks */, 152 | 8F5CDEBF1B9249A200C6672C /* Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | 8F5CDEC31B9249A200C6672C /* PBXTargetDependency */, 158 | ); 159 | name = "XMLParser DemoTests"; 160 | productName = "XMLParser DemoTests"; 161 | productReference = 8F5CDEC11B9249A200C6672C /* XMLParser DemoTests.xctest */; 162 | productType = "com.apple.product-type.bundle.unit-test"; 163 | }; 164 | /* End PBXNativeTarget section */ 165 | 166 | /* Begin PBXProject section */ 167 | 8F5CDEA51B9249A200C6672C /* Project object */ = { 168 | isa = PBXProject; 169 | attributes = { 170 | LastUpgradeCheck = 0700; 171 | ORGANIZATIONNAME = "DotMyWay LCC"; 172 | TargetAttributes = { 173 | 8F5CDEAC1B9249A200C6672C = { 174 | CreatedOnToolsVersion = 7.0; 175 | }; 176 | 8F5CDEC01B9249A200C6672C = { 177 | CreatedOnToolsVersion = 7.0; 178 | TestTargetID = 8F5CDEAC1B9249A200C6672C; 179 | }; 180 | }; 181 | }; 182 | buildConfigurationList = 8F5CDEA81B9249A200C6672C /* Build configuration list for PBXProject "XMLParser Demo" */; 183 | compatibilityVersion = "Xcode 3.2"; 184 | developmentRegion = English; 185 | hasScannedForEncodings = 0; 186 | knownRegions = ( 187 | en, 188 | Base, 189 | ); 190 | mainGroup = 8F5CDEA41B9249A200C6672C; 191 | productRefGroup = 8F5CDEAE1B9249A200C6672C /* Products */; 192 | projectDirPath = ""; 193 | projectRoot = ""; 194 | targets = ( 195 | 8F5CDEAC1B9249A200C6672C /* XMLParser Demo */, 196 | 8F5CDEC01B9249A200C6672C /* XMLParser DemoTests */, 197 | ); 198 | }; 199 | /* End PBXProject section */ 200 | 201 | /* Begin PBXResourcesBuildPhase section */ 202 | 8F5CDEAB1B9249A200C6672C /* Resources */ = { 203 | isa = PBXResourcesBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | 8F5CDEBB1B9249A200C6672C /* LaunchScreen.storyboard in Resources */, 207 | 8F5CDEB81B9249A200C6672C /* Assets.xcassets in Resources */, 208 | 8F5CDEB61B9249A200C6672C /* Main.storyboard in Resources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | 8F5CDEBF1B9249A200C6672C /* Resources */ = { 213 | isa = PBXResourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | /* End PBXResourcesBuildPhase section */ 220 | 221 | /* Begin PBXShellScriptBuildPhase section */ 222 | 1785C9C39618AAD7A38C1BEB /* Check Pods Manifest.lock */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | ); 229 | name = "Check Pods Manifest.lock"; 230 | outputPaths = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 235 | showEnvVarsInLog = 0; 236 | }; 237 | C82AB3B538C8B6026FD4B796 /* Embed Pods Frameworks */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputPaths = ( 243 | ); 244 | name = "Embed Pods Frameworks"; 245 | outputPaths = ( 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | shellPath = /bin/sh; 249 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-frameworks.sh\"\n"; 250 | showEnvVarsInLog = 0; 251 | }; 252 | F47E1E10086535560C6249F5 /* Copy Pods Resources */ = { 253 | isa = PBXShellScriptBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | inputPaths = ( 258 | ); 259 | name = "Copy Pods Resources"; 260 | outputPaths = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XMLParser Demo/Pods-XMLParser Demo-resources.sh\"\n"; 265 | showEnvVarsInLog = 0; 266 | }; 267 | /* End PBXShellScriptBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 8F5CDEA91B9249A200C6672C /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 8F5CDEB31B9249A200C6672C /* ViewController.swift in Sources */, 275 | 8F5CDEB11B9249A200C6672C /* AppDelegate.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 8F5CDEBD1B9249A200C6672C /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 8F5CDEC61B9249A200C6672C /* XMLParser_DemoTests.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | /* End PBXSourcesBuildPhase section */ 288 | 289 | /* Begin PBXTargetDependency section */ 290 | 8F5CDEC31B9249A200C6672C /* PBXTargetDependency */ = { 291 | isa = PBXTargetDependency; 292 | target = 8F5CDEAC1B9249A200C6672C /* XMLParser Demo */; 293 | targetProxy = 8F5CDEC21B9249A200C6672C /* PBXContainerItemProxy */; 294 | }; 295 | /* End PBXTargetDependency section */ 296 | 297 | /* Begin PBXVariantGroup section */ 298 | 8F5CDEB41B9249A200C6672C /* Main.storyboard */ = { 299 | isa = PBXVariantGroup; 300 | children = ( 301 | 8F5CDEB51B9249A200C6672C /* Base */, 302 | ); 303 | name = Main.storyboard; 304 | sourceTree = ""; 305 | }; 306 | 8F5CDEB91B9249A200C6672C /* LaunchScreen.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 8F5CDEBA1B9249A200C6672C /* Base */, 310 | ); 311 | name = LaunchScreen.storyboard; 312 | sourceTree = ""; 313 | }; 314 | /* End PBXVariantGroup section */ 315 | 316 | /* Begin XCBuildConfiguration section */ 317 | 8F5CDEC81B9249A200C6672C /* Debug */ = { 318 | isa = XCBuildConfiguration; 319 | buildSettings = { 320 | ALWAYS_SEARCH_USER_PATHS = NO; 321 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 322 | CLANG_CXX_LIBRARY = "libc++"; 323 | CLANG_ENABLE_MODULES = YES; 324 | CLANG_ENABLE_OBJC_ARC = YES; 325 | CLANG_WARN_BOOL_CONVERSION = YES; 326 | CLANG_WARN_CONSTANT_CONVERSION = YES; 327 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 328 | CLANG_WARN_EMPTY_BODY = YES; 329 | CLANG_WARN_ENUM_CONVERSION = YES; 330 | CLANG_WARN_INT_CONVERSION = YES; 331 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 332 | CLANG_WARN_UNREACHABLE_CODE = YES; 333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 335 | COPY_PHASE_STRIP = NO; 336 | DEBUG_INFORMATION_FORMAT = dwarf; 337 | ENABLE_STRICT_OBJC_MSGSEND = YES; 338 | ENABLE_TESTABILITY = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu99; 340 | GCC_DYNAMIC_NO_PIC = NO; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_OPTIMIZATION_LEVEL = 0; 343 | GCC_PREPROCESSOR_DEFINITIONS = ( 344 | "DEBUG=1", 345 | "$(inherited)", 346 | ); 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 354 | MTL_ENABLE_DEBUG_INFO = YES; 355 | ONLY_ACTIVE_ARCH = YES; 356 | SDKROOT = iphoneos; 357 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 358 | }; 359 | name = Debug; 360 | }; 361 | 8F5CDEC91B9249A200C6672C /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ALWAYS_SEARCH_USER_PATHS = NO; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BOOL_CONVERSION = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN_UNREACHABLE_CODE = YES; 377 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 378 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 379 | COPY_PHASE_STRIP = NO; 380 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 381 | ENABLE_NS_ASSERTIONS = NO; 382 | ENABLE_STRICT_OBJC_MSGSEND = YES; 383 | GCC_C_LANGUAGE_STANDARD = gnu99; 384 | GCC_NO_COMMON_BLOCKS = YES; 385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 387 | GCC_WARN_UNDECLARED_SELECTOR = YES; 388 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 389 | GCC_WARN_UNUSED_FUNCTION = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 392 | MTL_ENABLE_DEBUG_INFO = NO; 393 | SDKROOT = iphoneos; 394 | VALIDATE_PRODUCT = YES; 395 | }; 396 | name = Release; 397 | }; 398 | 8F5CDECB1B9249A200C6672C /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | baseConfigurationReference = FCC9F207E41628FDBFDBC46A /* Pods-XMLParser Demo.debug.xcconfig */; 401 | buildSettings = { 402 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 403 | INFOPLIST_FILE = "XMLParser Demo/Info.plist"; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 405 | PRODUCT_BUNDLE_IDENTIFIER = "com.dotmyway.XMLParser-Demo"; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | }; 408 | name = Debug; 409 | }; 410 | 8F5CDECC1B9249A200C6672C /* Release */ = { 411 | isa = XCBuildConfiguration; 412 | baseConfigurationReference = 7FFA3F7E4F8B2CBB04B9137D /* Pods-XMLParser Demo.release.xcconfig */; 413 | buildSettings = { 414 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 415 | INFOPLIST_FILE = "XMLParser Demo/Info.plist"; 416 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 417 | PRODUCT_BUNDLE_IDENTIFIER = "com.dotmyway.XMLParser-Demo"; 418 | PRODUCT_NAME = "$(TARGET_NAME)"; 419 | }; 420 | name = Release; 421 | }; 422 | 8F5CDECE1B9249A200C6672C /* Debug */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | BUNDLE_LOADER = "$(TEST_HOST)"; 426 | INFOPLIST_FILE = "XMLParser DemoTests/Info.plist"; 427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 428 | PRODUCT_BUNDLE_IDENTIFIER = "com.dotmyway.XMLParser-DemoTests"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XMLParser Demo.app/XMLParser Demo"; 431 | }; 432 | name = Debug; 433 | }; 434 | 8F5CDECF1B9249A200C6672C /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | BUNDLE_LOADER = "$(TEST_HOST)"; 438 | INFOPLIST_FILE = "XMLParser DemoTests/Info.plist"; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 440 | PRODUCT_BUNDLE_IDENTIFIER = "com.dotmyway.XMLParser-DemoTests"; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XMLParser Demo.app/XMLParser Demo"; 443 | }; 444 | name = Release; 445 | }; 446 | /* End XCBuildConfiguration section */ 447 | 448 | /* Begin XCConfigurationList section */ 449 | 8F5CDEA81B9249A200C6672C /* Build configuration list for PBXProject "XMLParser Demo" */ = { 450 | isa = XCConfigurationList; 451 | buildConfigurations = ( 452 | 8F5CDEC81B9249A200C6672C /* Debug */, 453 | 8F5CDEC91B9249A200C6672C /* Release */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 8F5CDECA1B9249A200C6672C /* Build configuration list for PBXNativeTarget "XMLParser Demo" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 8F5CDECB1B9249A200C6672C /* Debug */, 462 | 8F5CDECC1B9249A200C6672C /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | defaultConfigurationName = Release; 466 | }; 467 | 8F5CDECD1B9249A200C6672C /* Build configuration list for PBXNativeTarget "XMLParser DemoTests" */ = { 468 | isa = XCConfigurationList; 469 | buildConfigurations = ( 470 | 8F5CDECE1B9249A200C6672C /* Debug */, 471 | 8F5CDECF1B9249A200C6672C /* Release */, 472 | ); 473 | defaultConfigurationIsVisible = 0; 474 | defaultConfigurationName = Release; 475 | }; 476 | /* End XCConfigurationList section */ 477 | }; 478 | rootObject = 8F5CDEA51B9249A200C6672C /* Project object */; 479 | } 480 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // XMLParser Demo 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XMLParser 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 19 | 20 | /// Parsing an XML string from a Dictionary 21 | let body = [ 22 | "request" : [ 23 | "meta" : [ 24 | "type" : "getOrder", 25 | "date" : "2015-08-29 12:00:00", 26 | "device_name" : "iPhone 6 Plus", 27 | "device_os_version" : "iOS 9" 28 | ] 29 | ], 30 | 31 | "encryption" : [ 32 | "type" : "RSA" 33 | ] 34 | ] 35 | 36 | let header = "\n" 37 | let result = XMLParser.sharedParser.encode(body, header: header) 38 | print(result) 39 | 40 | 41 | /// Extracting data from an XML converted string 42 | let convertedString = "getOrder2015-08-29 12:00:00iPhone 6 PlusiOS 9RSA" 43 | let result1 = XMLParser.sharedParser.decode(convertedString) 44 | print(result1) 45 | 46 | return true 47 | } 48 | 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser Demo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // XMLParser Demo 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /XMLParser Demo/XMLParser DemoTests/XMLParser_DemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLParser_DemoTests.swift 3 | // XMLParser DemoTests 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import XMLParser_Demo 11 | 12 | class XMLParser_DemoTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /XMLParser.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "XMLParser" 4 | s.version = "1.0" 5 | s.summary = "A lightweight XMLParser for assembling and parsing XML values written for iOS 8+ in Swift 2. " 6 | s.homepage = "https://github.com/Mozharovsky/XMLParser" 7 | s.license = { :type => "MIT", :file => "LICENSE" } 8 | s.author = { "Eugene Mozharovsky" => "mozharovsky@live.com" } 9 | s.social_media_url = "https://twitter.com/DottieYottie" 10 | s.platform = :ios, "8.0" 11 | s.ios.deployment_target = "8.0" 12 | s.source = { :git => "https://github.com/Mozharovsky/XMLParser.git", :tag => s.version } 13 | s.source_files = "XMLParser/*.swift" 14 | s.requires_arc = true 15 | 16 | end 17 | -------------------------------------------------------------------------------- /XMLParser/Dictionary+XMLParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dictionary+XMLParser.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A convenience extension for assembling tries from 12 | /// a dictionary with values (XML representation). 13 | public extension Dictionary { 14 | 15 | // MARK: - Initialization 16 | 17 | /// Merges current dictionary with a given dictionary. 18 | public mutating func merge(sequence: S) { 19 | for (key, value) in sequence { 20 | self[key] = value 21 | } 22 | } 23 | 24 | /// An initializer for merging two dictionaries. 25 | public init(sequence: S) { 26 | self.init() 27 | merge(sequence) 28 | } 29 | 30 | /// An initializer for merging current dictionary and pairs ([Key, Value]). 31 | public init(pairs: [(Key, Value)]) { 32 | self.init() 33 | merge(pairs) 34 | } 35 | 36 | /// Creates pairs (Key,Value) from the dictionary. 37 | private func pairs(var tree: [Dictionary] = [[:]]) -> (keys: [Key], values: [Value]) { 38 | if tree.isEmpty { 39 | tree = dictionariesTree() 40 | } 41 | 42 | var keys: Set = [] 43 | var values: [Value] = [] 44 | 45 | for dict in tree { 46 | for (key, value) in dict { 47 | keys.insert(key) 48 | 49 | if !collection(values, hasElement: value) { 50 | values += [value] 51 | } 52 | } 53 | } 54 | 55 | return (keys.map { $0 }, values) 56 | } 57 | 58 | /// Converts an NSDictionary into a pure Swift Dictionary with generic 59 | /// Key, Value pair. 60 | public static func convertedDictionary(dictionary: NSDictionary) -> Dictionary { 61 | let _dictionary = dictionary.copy() as! NSDictionary 62 | var dict = Dictionary() 63 | for (key, value) in _dictionary { 64 | if let key = key as? XMLTag { 65 | dict[key] = value 66 | } else if let key = XMLTag(anyValue: key) { 67 | dict[key] = value 68 | } 69 | } 70 | 71 | return dict 72 | } 73 | 74 | /// An initializer for creating a pure Swift Dictionary 75 | /// from Cocoa NSDictionary analogue. 76 | public init(dictionary: NSDictionary) { 77 | let pairs = dictionary.map { ($0.key as? Key, $0.value as? Value) } 78 | let prepared = pairs.filter { ($0.0 != nil && $0.1 != nil) } 79 | self.init(pairs: prepared as! [(Key, Value)]) 80 | } 81 | 82 | /// Returns a Cocoa NSDictionary from the pure Swift Dictionary. 83 | public func standardDictionary() -> NSDictionary { 84 | let dict = NSMutableDictionary() 85 | for (k, v) in self { 86 | if let key = k as? NSCopying, value = v as? AnyObject { 87 | dict[key] = value 88 | } 89 | } 90 | 91 | return dict 92 | } 93 | 94 | // MARK: - Assembling tries 95 | 96 | /// Assembles a general tree for the given dictionary. 97 | public func dictionariesTree() -> [Dictionary] { 98 | var collections: Set = [] 99 | collections.insert(self.standardDictionary()) 100 | 101 | func iterate(dictionary: Dictionary) { 102 | for (_, value) in dictionary { 103 | if let dict = value as? NSDictionary where !collections.contains(dict) { 104 | collections.insert(dict) 105 | iterate(Dictionary.convertedDictionary(dict) as Dictionary) 106 | } 107 | } 108 | } 109 | 110 | iterate(Dictionary.convertedDictionary(self.standardDictionary()) as Dictionary) 111 | 112 | return collections.map { Dictionary(dictionary: $0) } 113 | } 114 | 115 | /// Determines if an array with this dictionary's values contains one. 116 | private func collection(values: [Value], hasElement value: Value) -> Bool { 117 | let contains = values.contains { (element: Value) in 118 | return self.value(value, equalToValue: element) 119 | } 120 | 121 | return contains 122 | } 123 | 124 | /// Equatable analogue. 125 | private func value(value: Value, equalToValue other: Value) -> Bool { 126 | if let value = value as? NSNumber, other = other as? NSNumber { 127 | return value == other 128 | } else if let value = value as? NSValue, other = other as? NSValue { 129 | return value == other 130 | } 131 | 132 | return false 133 | } 134 | 135 | // TODO: Fix for parsing arrays as well 136 | 137 | /// Create an array of tries (for high level tags). 138 | public func generateTries() -> [Tree]? { 139 | var collections: Set = [] 140 | var chains: [Tree] = [] 141 | 142 | let initial = standardDictionary() 143 | collections.insert(initial) 144 | 145 | func iterate(dictionary: Dictionary, lastChain: Tree?) { 146 | for (key, value) in dictionary { 147 | let chain = Tree(previous: lastChain, node: (key, "\(value)"), next: nil) 148 | chains += [chain] 149 | 150 | if let lastChain = lastChain { 151 | if lastChain.next == nil { 152 | lastChain.next = [] 153 | } 154 | 155 | lastChain.next! += [chain] 156 | } 157 | 158 | 159 | 160 | if let dict = value as? NSDictionary where !collections.contains(dict) { 161 | collections.insert(dict) 162 | iterate(Dictionary.convertedDictionary(dict), lastChain: chain) 163 | } 164 | } 165 | } 166 | 167 | iterate(Dictionary.convertedDictionary(initial), lastChain: nil) 168 | 169 | chains = chains.filter { $0.first() == $0 } 170 | 171 | return chains 172 | } 173 | } -------------------------------------------------------------------------------- /XMLParser/String+XMLParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+XMLParser.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A convenience extension for parsing a string into an XML structure. 12 | public extension String { 13 | /// XML begin tag (e.g. ``). 14 | public func startHeader() -> String { 15 | if !hasPrefix("<") && !hasSuffix(">") { 16 | return "<\(self)>" 17 | } 18 | 19 | return self 20 | } 21 | 22 | /// XML end tag (e.g. ``). 23 | public func endHeader() -> String { 24 | if !hasPrefix("<") && !hasSuffix(">") { 25 | return "" 26 | } 27 | 28 | return self 29 | } 30 | 31 | /// XML tag value (e.g. from `` the result is 'request'). 32 | public func original() -> String { 33 | var start = startIndex 34 | var end = endIndex 35 | 36 | if hasPrefix("<") { 37 | start++ 38 | 39 | if self[start..") { 46 | end-- 47 | } 48 | 49 | return self[start.. { 13 | 14 | // MARK: - Properties 15 | 16 | /// The previous tree if any. It should be weak since it's an optional 17 | /// and besides we don't want to face cycled referencing. 18 | public weak var previous: Tree? 19 | 20 | /// Self node with values *name* and *value*. 21 | public let node: (tag: XMLTag, value: T) 22 | 23 | /// The next tree if any. 24 | public var next: [Tree]? 25 | 26 | /// Defines the indentation level. 27 | private let multiplier = 3 28 | 29 | /// A tmp counter for steps. 30 | private lazy var _steps = 0 31 | 32 | /// Steps for reaching the very first tree. 33 | public var steps: Int { 34 | get { 35 | if let previous = previous { 36 | previous._steps = ++_steps 37 | return previous.steps 38 | } else { 39 | let copy = self._steps 40 | self._steps = 0 41 | return copy 42 | } 43 | } 44 | 45 | } 46 | 47 | // MARK: - Initialization 48 | 49 | /// A general initializer. 50 | public init(previous: Tree?, node: (XMLTag, T), next: [Tree]?) { 51 | self.previous = previous 52 | self.node = node 53 | self.next = next 54 | } 55 | 56 | // MARK: - Convenience stuff 57 | 58 | public convenience init(node: (XMLTag, T)) { 59 | self.init(previous: nil, node: node, next: nil) 60 | } 61 | 62 | public convenience init(previous: Tree, node: (XMLTag, T)) { 63 | self.init(previous: previous, node: node, next: nil) 64 | } 65 | 66 | public convenience init(node: (XMLTag, T), next: [Tree]) { 67 | self.init(previous: nil, node: node, next: next) 68 | } 69 | 70 | // MARK: - Utils 71 | 72 | /// Returns the very first tree. 73 | public func first() -> Tree { 74 | if let previous = previous { 75 | return previous.first() 76 | } else { 77 | return self 78 | } 79 | } 80 | } 81 | 82 | // MARK: - Parsing utils 83 | 84 | extension Tree { 85 | /// A util function that parsed the current tree structure into 86 | /// an XML string. 87 | public func parsedRequestBody() -> String { 88 | var body = "" 89 | 90 | func spaces(count: Int) -> String { 91 | var string = "" 92 | for _ in 0..) { 100 | let spaces = spaces(tree.steps * multiplier) 101 | 102 | if body.characters.count > 0 && body.characters.last != "\n" { 103 | body += "\n" 104 | } 105 | 106 | body += spaces 107 | let tag = tree.node.tag 108 | body += (tag.header + (tag.name != nil ? " " + tag.name! : "") + (tag.value != nil ? "=\'\(tag.value!)\'" : "")).startHeader() 109 | 110 | 111 | if ((tree.next == nil) || (tree.next?.count == 0)) && ((tree.node.value as? NSDictionary) == nil) { 112 | body += "\(tree.node.value)" 113 | } 114 | 115 | if let tries = tree.next { 116 | for tree in tries { 117 | process(tree) 118 | } 119 | } 120 | 121 | if body.characters.last == "\n" { 122 | body += spaces 123 | } 124 | 125 | body += tag.header.endHeader() 126 | body += "\n" 127 | } 128 | 129 | process(self) 130 | 131 | return body 132 | 133 | } 134 | } 135 | 136 | // MARK: - Equatable 137 | 138 | public func ==(lhs: Tree, rhs: Tree) -> Bool { 139 | return lhs === rhs 140 | } 141 | -------------------------------------------------------------------------------- /XMLParser/XMLCoder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLCoder.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A protocol for encoding a dictionary with values into an XML string. 12 | public protocol XMLCoder { 13 | /// Encodes a dictionary into an XML string. 14 | /// - parameter data: A generic dictionary. Generally, the **Key** should be hashable and 15 | /// in most of cases it must be a **String**. The value 16 | /// might vary. 17 | /// - parameter header: A header for the XML string. 18 | /// - returns: A converted XML string. 19 | func encode(data: Dictionary, header: String) -> String 20 | } -------------------------------------------------------------------------------- /XMLParser/XMLDecoder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLDecoder.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A protocol for decoding an input value into an output array. 12 | public protocol XMLDecoder { 13 | typealias Input 14 | typealias Output 15 | 16 | /// Decodes the given input into the specified output. 17 | /// - parameter data: An input data, it is defined as a generic 18 | /// type but in fact you must provide a **String** input. 19 | /// - returns: A defined output, should be an array of values. 20 | func decode(data: Input) -> Output 21 | } -------------------------------------------------------------------------------- /XMLParser/XMLParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLParser.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/29/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A parser class supposed to provide features for (de)coding 12 | /// data into XML and vice versa. 13 | /// The class provides a singleton. 14 | public class XMLParser: XMLCoder, XMLDecoder { 15 | /// A singleton accessor. 16 | public static let sharedParser = XMLParser() 17 | 18 | // MARK: - XMLCoder & XMLDecoder 19 | 20 | /// Encodes a dictionary into an XML string. 21 | /// - parameter data: A generic dictionary. Generally, the **Key** should be hashable and 22 | /// in most of cases it must be a **String**. The value 23 | /// might vary. 24 | /// - parameter header: A header for the XML string. 25 | /// - returns: A converted XML string. 26 | public func encode(data: Dictionary, header: String = "") -> String { 27 | guard let tries = data.generateTries() else { 28 | return "" 29 | } 30 | 31 | return header + tries.map { $0.parsedRequestBody() }.reduce("", combine: +) 32 | } 33 | 34 | /// Decodes the given input into the specified output. 35 | /// - parameter data: An input data, *String* type. 36 | /// - returns: An array of string values. 37 | public func decode(data: String) -> Dictionary { 38 | return findTags(data) 39 | } 40 | 41 | // MARK: - Initialization 42 | 43 | /// A private initializer for singleton implementation. 44 | private init() { } 45 | 46 | // MARK: - Utils 47 | 48 | /// Finds XML tags in a given string (supposed to be previously parsed into XML format). 49 | /// - parameter body: A given XML parsed string. 50 | /// - returns: A dictionary with arrays of values. 51 | private func findTags(body: String) -> [String : [String]] { 52 | var keys: [String] = [] 53 | 54 | var write = false 55 | var char = "" 56 | var value = "" 57 | var values: [String : [String]] = [:] 58 | 59 | for ch in body.characters { 60 | if ch == "<" { 61 | write = true 62 | } else if ch == ">" { 63 | write = false 64 | } 65 | 66 | if ch == "\n" { 67 | continue 68 | } 69 | 70 | if write { 71 | if let last = keys.last where value != "" { 72 | if let _ = values[last.original()] { 73 | values[last.original()]! += [value] 74 | } else { 75 | values[last.original()] = [] 76 | values[last.original()]! += [value] 77 | } 78 | value = "" 79 | } 80 | 81 | char += String(ch) 82 | } else { 83 | if char != "" { 84 | char += String(ch) 85 | keys += [char] 86 | char = "" 87 | } else if let last = keys.last where last == last.original().startHeader() { 88 | if ch == " " && (value.characters.last == " " || value.characters.last == "\n" || value.characters.count == 0) { 89 | continue 90 | } 91 | 92 | value += String(ch) 93 | } 94 | } 95 | } 96 | 97 | return values 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /XMLParser/XMLTag.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XMLTag.swift 3 | // XMLParser 4 | // 5 | // Created by Eugene Mozharovsky on 8/30/15. 6 | // Copyright © 2015 DotMyWay LCC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// An XML rich tag, e.g. ``. 12 | public class XMLTag: NSObject, Tag, StringLiteralConvertible { 13 | /// A header for a tag. Used to indicate start/end of the cell. 14 | /// (`` -> 'td') 15 | public let header: String 16 | 17 | /// A name of the tag. 18 | /// (`` -> 'class') 19 | public let name: String? 20 | 21 | /// A value for a tag. 22 | /// (`` -> 'num') 23 | public let value: String? 24 | 25 | // MARK: - StringLiteralConvertible 26 | 27 | /// An initializer from String. 28 | /// e.g. `let tag: XMLTag = "myTag"` 29 | public required init(stringLiteral value: String) { 30 | self.header = value 31 | self.name = nil 32 | self.value = nil 33 | } 34 | 35 | public required init(unicodeScalarLiteral value: String){ 36 | self.header = value 37 | self.name = nil 38 | self.value = nil 39 | } 40 | 41 | required public init(extendedGraphemeClusterLiteral value: String) { 42 | self.header = value 43 | self.name = nil 44 | self.value = nil 45 | } 46 | 47 | // MARK: - General initializer 48 | 49 | /// A general initializer. Header is required, when name and value 50 | /// are optional parameters. 51 | public init(header: String, name: String? = nil, value: String? = nil) { 52 | self.header = header 53 | self.name = name 54 | self.value = value 55 | } 56 | 57 | /// A failable initializer. Tries to automatically 58 | /// cast a given type to *String*, if can't be done 59 | /// returns nil. 60 | public init?(anyValue: Any) { 61 | if let string = anyValue as? NSString { 62 | self.header = String(string) 63 | self.name = nil 64 | self.value = nil 65 | super.init() 66 | } else { 67 | self.header = "" 68 | self.name = nil 69 | self.value = nil 70 | super.init() 71 | 72 | return nil 73 | } 74 | } 75 | } 76 | 77 | // MARK: - NSCopying 78 | 79 | extension XMLTag: NSCopying { 80 | @objc public func copyWithZone(zone: NSZone) -> AnyObject { 81 | return XMLTag(header: header, name: name, value: value) 82 | } 83 | } --------------------------------------------------------------------------------