{"id":21874074,"url":"https://github.com/eeue56/elm-xml","last_synced_at":"2025-04-15T01:14:19.274Z","repository":{"id":16440434,"uuid":"79666873","full_name":"eeue56/elm-xml","owner":"eeue56","description":"xml parser for elm","archived":false,"fork":false,"pushed_at":"2022-02-10T21:13:15.000Z","size":79,"stargazers_count":12,"open_issues_count":7,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T01:14:13.944Z","etag":null,"topics":["elm","elm-xml","xml-parser"],"latest_commit_sha":null,"homepage":null,"language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eeue56.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":"2017-01-21T19:11:59.000Z","updated_at":"2024-02-07T18:30:47.000Z","dependencies_parsed_at":"2022-08-07T08:15:23.281Z","dependency_job_id":null,"html_url":"https://github.com/eeue56/elm-xml","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eeue56","download_url":"https://codeload.github.com/eeue56/elm-xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986316,"owners_count":21194025,"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":["elm","elm-xml","xml-parser"],"created_at":"2024-11-28T07:10:57.790Z","updated_at":"2025-04-15T01:14:19.247Z","avatar_url":"https://github.com/eeue56.png","language":"Elm","readme":"# elm-xml [![Build Status](https://travis-ci.org/eeue56/elm-xml.svg?branch=master)](https://travis-ci.org/eeue56/elm-xml)\nxml parser for elm\n\nFirst bring XML into Elm as a `Value`. Once imported as a Value, you can then either query the values with `Xml.Query`.\n\nOr you can turn it back to a string using `Xml.Encode.encode`. Or pull it apart using `Xml.Encode.Value`.\n\nIn order to turn an `Xml.Value` into a record, you probably want `Xml.Query`, paired with `Result.map`.\n\n```elm\n\nimport Xml exposing (Value)\nimport Xml.Encode exposing (null)\nimport Xml.Decode exposing (decode)\nimport Xml.Query exposing (tags)\n\ndecodedXml : Value\ndecodedXml = \n\t\"\"\"\n\u003cperson\u003e\n\t\u003cname\u003enoah\u003c/name\u003e\n\t\u003cage max=\"100\"\u003e50\u003c/age\u003e\n\u003c/person\u003e\n\u003cperson\u003e\n\t\u003cname\u003ejosh\u003c/name\u003e\n\t\u003cage max=\"100\"\u003e57\u003c/age\u003e\n\u003c/person\u003e\n\t\"\"\"\n\t\t|\u003e decode\n\t\t|\u003e Result.toMaybe\n\t\t|\u003e Maybe.withDefault null\n\n\ntype alias Person = \n\t{ name: String\n\t, age: Int\n\t}\n\nperson : Value -\u003e Result String Person\nperson value =\n    Result.map2\n        (\\name age -\u003e\n            { name = name\n            , age = age\n            }\n        )\n        (tag \"name\" string value)\n        (tag \"age\" int value)\n\n\npeople : List Person\npeople =\n    tags \"person\" decodedXml\n        |\u003e collect person\n\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feeue56%2Felm-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feeue56%2Felm-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feeue56%2Felm-xml/lists"}