atom validation for ejabberd xml
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


= atom_ejabberd =

This bit of code is designed to validate pubsub ( atom ( entry payload.

== USAGE ==

atom:check(Payload) returns valid | {invalid, first_error_message}

Payload is an ejabberd xmlelement tuple.

Also included is a node_atom enforcing atom.

You need to have the xml and xml_stream modules from ejabberd in your BEAM path for parsing.

== Building ==

Do it manually with erlc. I may provide a build script someday.

== Notes ==

It only checks entries and not feeds. It is designed as a server component that receives entries for publishing.

Namespaces should be handled well as long as atom itself is the base namespace. (no <atom:entry>)

== A volontary step away from the atom spec ==

I have decided not to check for atom:author, even though the entry is not in a feed, as XMPP pubsub makes it pretty clear who's actually publishing.

== TODO ==

There are few bits and pieces not implemented yet. For instance :

 - dates are not validated

 - IRI are not checked as being valid

 - emails are not validated either

 - atom:source is weakly checked (it just accepts it as is)

 - better handle the namespacing / provide an extension hook to check foreign namespaces

Integrate with

build script

== Testing ==

The EUnit unit tests provide good coverage.

sam.atom and tim.atom are sample entries from Sam Ruby and Tim Bray's atom feed. I used them for testing (check out atom:check_entry() )

== License == 

Licensed under the EPL

== Author ==

Eric Cestari <>
Website :