Hex pm Build Status License

Modern Erlang / Elixir library for XML <-> map serialisation and deserialisation using XSD schema powered by OTP/xmerl

Version: 1.0.0


Erlxml provides more modern approach for working with data coming from XML sources. In order for Erlxml to determine how to deserialise XML a XML-schema also known as XSD must be provided.

Erlxml will validate against the provided XSD on serialisation and deserialisation. This includes extensive type checks - Validation is done by xmerl_xsd module.

Type casting of data is will be attempted altough only a limited set of XML types is supported at this stage:

These and all other types are validated by the xmerl_xsd module, Erlxml handles unkown types gracefully by casting them to a binary string.

About maps and lists

Erlxml deserialises XML data into maps. It uses the XML-schema (XSD) to determine if a tag contains a list of tags or just some properties - Eg. books -> list of books vs book -> title, description etc. Consider:

   % List element
   #{books=> [
   #{book => #{title => <<"Title">>, desc => <<"Desc">>}}
   % Non-list element
   #{book => #{title => <<"title">>, desc => <<"desc">>}}

To determine if a tag should be deserialised as a 'list-element' Erlxml uses the 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'.



To be done



For issues, comments or feedback please create an issue.