{"id":13871936,"url":"https://github.com/JaapWijnen/swift-xml-parser","last_synced_at":"2025-07-16T01:32:18.162Z","repository":{"id":37965962,"uuid":"452290650","full_name":"JaapWijnen/swift-xml-parser","owner":"JaapWijnen","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-03T16:47:10.000Z","size":52,"stargazers_count":7,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-21T03:45:16.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaapWijnen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-26T13:41:59.000Z","updated_at":"2024-07-10T01:12:30.000Z","dependencies_parsed_at":"2022-07-10T00:46:21.001Z","dependency_job_id":null,"html_url":"https://github.com/JaapWijnen/swift-xml-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaapWijnen%2Fswift-xml-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaapWijnen%2Fswift-xml-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaapWijnen%2Fswift-xml-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaapWijnen%2Fswift-xml-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaapWijnen","download_url":"https://codeload.github.com/JaapWijnen/swift-xml-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225878124,"owners_count":17538400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-05T23:00:30.779Z","updated_at":"2024-11-23T19:31:26.568Z","avatar_url":"https://github.com/JaapWijnen.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# swift-xml-parser\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FJaapWijnen%2Fswift-xml-parser%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/JaapWijnen/swift-xml-parser)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FJaapWijnen%2Fswift-xml-parser%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/JaapWijnen/swift-xml-parser)\n\nA reversible XML parser powered by the excellent [swift-parsing][swift-parsing] package by [pointfree.co][pointfree]\n\n## Getting Started\n\n```swift\nvar input = \"\"\"\n\u003c?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?\u003e\n\u003croot\u003e\n    \u003ccontent attribute1=\"value\" /\u003e\n\u003c/root\u003e\n\"\"\"\n\n// The `XMLParser` type takes a single `Bool` parameter which determines the printing mode (with or without newlines/indentation)\nlet xml = try XMLParser(indenting: true).parse(input)\n//XML(\n//    prolog: [\n//        \"version\": \"1.0\", \n//        \"encoding\": \"utf-8\"\n//    ], \n//    root: XML.Element(\n//        name: \"root\", \n//        attributes: [:], \n//        content: [\n//            .element(.init(name: \"content\", attributes: [\"attribute1\": \"value\"]))\n//        ]\n//    )\n//)\n\nlet indentedPrintedXML = xmlParser(true).print(xml)\n//\u003c?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?\u003e\n//\u003croot\u003e\n//    \u003ccontent attribute1=\"value\"/\u003e\n//\u003c/root\u003e\n\nlet flatPrintedXML = xmlParser(false).print(xml)\n//\u003c?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?\u003e\u003croot\u003e\u003ccontent attribute1=\"value\"/\u003e\u003c/root\u003e\n```\n\n## License\n\nThis library is released under the MIT license. See [LICENSE](LICENSE) for details.\n\n[swift-parsing]: https://github.com/pointfreeco/swift-parsing\n[pointfree]: https://pointfree.co\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaapWijnen%2Fswift-xml-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJaapWijnen%2Fswift-xml-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaapWijnen%2Fswift-xml-parser/lists"}