Skip to content

Convert XML into Hiccup in Clojure and ClojureScript.

License

Notifications You must be signed in to change notification settings

kuhumcst/xml-hiccup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XML Hiccup

xml-hiccup

Clojure(Script) implementation of an XML parser that, more or less directly, converts an XML file into Hiccup data without trying to be clever about it.

Comments and superfluous whitespace are deliberately not preserved, while namespaces are converted into regular Clojure namespaces. No attempt is made to map namespace URIs to namespace aliases.

Usage

This example shows how to parse a File, though it could also be a String or an InputStream.

(require '[dk.cst.xml-hiccup :as xh]
         '[clojure.java.io :as io])

(xh/parse (io/file "test/test-1307-anno-tei.xml"))

NOTE: ClojureScript only supports parsing XML strings!

Why even use this?

For various reasons, I needed a library that can turn XML into identical Hiccup in both my backend code and my frontend code. This library does that.

About

Convert XML into Hiccup in Clojure and ClojureScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published