{"id":15470455,"url":"https://github.com/eyedouble/erlxml","last_synced_at":"2025-08-05T16:09:49.770Z","repository":{"id":57496746,"uuid":"208554910","full_name":"eyedouble/erlxml","owner":"eyedouble","description":"Erlang/Elixir maps XML serialiser/deserialiser with XSD validation","archived":false,"fork":false,"pushed_at":"2019-10-31T18:19:54.000Z","size":230,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T12:08:03.967Z","etag":null,"topics":["elixir","erlang","erlang-library","erlang-otp","maps","xmerl","xml","xml-deserialization","xml-encoder","xml-parser","xml-schema","xml-serialization","xsd","xsd-schema"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/eyedouble.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":"2019-09-15T06:58:34.000Z","updated_at":"2024-09-21T10:13:01.000Z","dependencies_parsed_at":"2022-09-16T09:51:10.759Z","dependency_job_id":null,"html_url":"https://github.com/eyedouble/erlxml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyedouble","download_url":"https://codeload.github.com/eyedouble/erlxml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237831,"owners_count":21397401,"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":["elixir","erlang","erlang-library","erlang-otp","maps","xmerl","xml","xml-deserialization","xml-encoder","xml-parser","xml-schema","xml-serialization","xsd","xsd-schema"],"created_at":"2024-10-02T02:04:46.190Z","updated_at":"2025-04-22T12:08:53.125Z","avatar_url":"https://github.com/eyedouble.png","language":"Erlang","readme":"# Erlxml\n\n[![Hex pm](https://img.shields.io/hexpm/v/erlxml.svg?style=flat-square\u0026labelColor=5c676d\u0026color=714a94)](https://hex.pm/packages/erlxml)\n[![Build Status](https://secure.travis-ci.org/eyedouble/erlxml.svg?branch=master\n\"Build Status\")](https://secure.travis-ci.org/eyedouble/erlxml)\n[![License](https://img.shields.io/github/license/eyedouble/erlxml?color=007ec6\u0026style=flat-square)](LICENSE)\n\n\n\n**Modern Erlang / Elixir library for XML \u003c-\u003e map serialisation and deserialisation using XSD schema powered by OTP/xmerl** \n\n- [Install from hex.pm](https://hex.pm/packages/erlxml)\n- [Documentation available on hexdoc](https://hexdocs.pm/erlxml)\n\n__Version:__ 1.0.0\n\n__Erlang/OTP:__ \u003e= 20\n\n## Summary\n\nErlxml provides more modern approach for working with data coming from XML sources.\nIn order for Erlxml to determine how to deserialise XML a XML-schema also known as \nXSD must be provided.\n\nErlxml will validate against the provided XSD on serialisation and deserialisation.\nThis includes extensive type checks - Validation is done by xmerl_xsd module.\n\nType casting of data is will be attempted altough only a limited set of \nXML types is supported at this stage:\n- `xs:string` \u003c\u003e `binary`\n- `xs:decimal` \u003c\u003e `float`\n- `xs:float` \u003c\u003e `float`\n- `xs:int` \u003c\u003e `integer`\n- `xs:integer` \u003c\u003e `integer`\n- `xs:positiveInteger` \u003c\u003e `integer`\n- `xs:negativeInteger` \u003c\u003e `integer`\n- `xs:nonPositiveInteger` \u003c\u003e `integer`\n- `xs:nonNegativeInteger` \u003c\u003e `integer`\n- `xs:date` \u003c\u003e `{YYYY, MM, DD}` (Only \"YYYY-MM-DD\" format is supported at this stage)\n- `xs:boolean` \u003c\u003e `boolean` or `0/1`\n\nThese and all other types are validated by the `xmerl_xsd` module, Erlxml handles unkown types \ngracefully by casting them to a binary string.\n\n### About maps and lists\nErlxml deserialises XML data into maps. It uses the XML-schema (XSD) to determine if\na `tag` contains a list of `tags` or just some properties - Eg. books -\u003e list of books vs book -\u003e title, description etc.  Consider:\n\n```\n   % List element\n   #{books=\u003e [\n   #{book =\u003e #{title =\u003e \u003c\u003c\"Title\"\u003e\u003e, desc =\u003e \u003c\u003c\"Desc\"\u003e\u003e}}\n   ]}\n   % Non-list element\n   #{book =\u003e #{title =\u003e \u003c\u003c\"Title\"\u003e\u003e, desc =\u003e \u003c\u003c\"Desc\"\u003e\u003e}}\n```\n\nTo determine if a `tag` should be deserialised as a 'list-element' Erlxml uses \nthe `maxOccurs` attribute in your XML-schema (XSD). All elements containing an element with a `maxOccurs` attribute with a value other than `1` are considered 'list-elements'. \n\n\n\n## About Schemas\nThe first line of your schema file (XSD-file) contain `\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e`.\n\nSchema namespace must be `xs:` for now as the library is not handeling schema namespaces dynamically yet.\n\n## Usage\n### Serialise\n- Build a Schema state by using `{ok, State} = erlxml:build_schema_state({file, \"path/to/example/file.xsd\"})`.\n- Call `erlxml:deserialise(#{'mock' =\u003e \"\"}, State)`.\n\n### Deserialise\n- Build a Schema state by using `{ok, State} = erlxml:build_schema_state({file, \"path/to/example/file.xsd\"})`.\n- Call `erlxml:deserialise(\"\u003cmock/\u003e\", State)`.\n\n\n\n## Contribute\n\nFor issues, comments or feedback please [create an\nissue](http://github.com/eyedouble/erlxml/issues).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedouble%2Ferlxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyedouble%2Ferlxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedouble%2Ferlxml/lists"}