Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

exml

Build Status

exml is an Erlang library helpful with parsing XML streams and doing some basic XML structures manipulation.

Building

exml is a rebar-compatible OTP application, run make or ./rebar compile in order to build it.

As a requirement, development headers for expat library are required.

Using

exml can parse both XML streams as well as single XML documents at once.

To parse a whole XML Document:

{ok, Parser} = exml:parse(<<"<my_xml_doc/>">>).

To generate an XML document from Erlang terms:

Xml = {xmlel,<<"foo">>,
        [{<<"attr1">>,<<"bar">>}], % Attributes
        [{xmlcdata,"Some Value"}] %Elements
      }.
exml:to_list(Xml).

Which results in

<foo attr1='bar'>Some Value</foo>

exml:to_binary/1 works similarly.

For an example of using the streaming API, so test/exml_stream_tests.erl

About

XML parsing library in Erlang

Resources

License

Packages

No packages published
You can’t perform that action at this time.