Monthly Downloads: 13
Programming language: Haskell
License: MIT License
Tags: XML    
Latest version: v0.1.0

c14n alternatives and similar packages

Based on the "XML" category.
Alternatively, view c14n alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of c14n or a related project?

Add another 'XML' Package



GitHub Haskell CI Hackage

Haskell bindings for the c14n implementation in libxml (XML canonicalisation). Unfortunately there is (at the time of writing) no pure Haskell implementation, so this seems like the best option.


You need to have libxml2 installed, including on macOS (with brew install libxml2). Then build with stack build.


The Text.XML.C14N module exports a function named c14n which provides a mid-level interface to the canonicalisation function from libxml2. It will handle most of the marshalling, but not much more. For example:

> c14n [] c14n_1_1 [] False Nothing "<root>foo<!-- comment -->bar</root>" 

The arguments, in order, are:

  • Parser options, see the module documentation or the libxml2 documentation
  • The canonicalisation specification to use (c14n_1_0, c14n_exclusive_1_0, or c14n_1_1).
  • A (potentially empty) list of namespace prefixes which is used when the canonicalisation specification used is c14n_exclusive_1_0
  • A boolean value indicating whether to keep comments in the output or not.
  • An XPath location path used to select a set of nodes that should be included in the canonicalised result

*Note that all licence references and agreements mentioned in the c14n README section above are relevant to that project's source code only.