Skip to content

grammati/eksemel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eksemel

XML wrangling for Clojure.

Eksemel can parse and emit XML similarly to clojure.xml, and in most cases should be suitable as a drop-in replacement.

In addition, it supports:

  • namespace-aware parsing and emitting
  • XML comments, CData sections, and processing instructions
  • configurable handling of whitespace when parsing
  • keeping line/column numbers in metadata
  • utility functions for manipulating elements

Usage

Leiningen:

(defproject my-project ...
  :description ...
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [eksemel "0.1.0-SNAPSHOT"]])

Example:

(ns my.ns
  (:require [eksemel.core :as xml]))

;; Parsing
(xml/parse "/path/to/some/file.xml")
(xml/parse "<some><xml in='a string'/><some>")

;; Emitting
(def e (xml/parse "<foo><bar/></foo>"))
(xml/emit e) ; returns a string
(xml/emit e *out*) ; writes to a Writer

License

Copyright (C) 2011 Chris Perkins

Distributed under the Eclipse Public License, the same as Clojure.

About

XML wrangling for Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published