Selectors for templating HTML's metadata
Christophe Grand's Enlive is a great tool, it makes HTML generation and parsing a breeze, that is if you're moderately familiar with CSS selectors.
When templating (or seaching) HTML/XML, most of the time you will be selecting by ID or CLASS, but for those times when you're not, such as making the HTML metadata SEO-friendly, you're going to need a special selector.
The HTML metadata looks like this:
<meta content="example I want to replace" name="description" />
If what you want to change is the content, then it's not selectable by either CLASS or ID. You just have to dig in a bit and use a boolean along with a few of Enlive's helper funcitons. Here is the code to do a template replacement of the metadata's content:
[(and (enlive/has [:meta]) (enlive/attr-has :name "description"))] (enlive/set-attr :content "Word's Eye: Converting Simple English Into 3D Scenes")