HTML search and replace in Clojure
In Clojure, data structures are mostly built from a handful of core data structures such as lists, vectors, maps, and sets.
This means that most data structures can leverage all of the generic data transformation and querying functions built for the core data structures instead of having to rebuild the same functionality for each data structure.
This feature in combination with Clojure's rich standard library makes Clojure very attractive for solving data munching problems from other domains.
In this article, I'm going to demonstrate these capabilities for solving HTML transformations using Clojure.
First, I'm going to describe how HTML can be represented in Clojure.
With this representation in mind, I'll demonstrate how we can transform HTML documents in Clojure.
Finally, I'll tie the transformations together with the HTML parsing and formatting to produce a complete solution.