Sunday, 8 February 2015

How to get the string in xml attributes as lower cases in clojure



I have the following xml



<?xml version="1.0" encoding="utf-8"?>
<Transformation>
<ColumnValidations>
<Column ColumnName="Column1"/>
<Column ColumnName="Column2" MinInclusive="100" MaxExclusive="10000"/>
<Column ColumnName="GREGORIAN_DATE" IsDate="Yes" Format="MM/DD/YYYY"/>
</ColumnValidations>
</Transformation>


Using xml/parse and tree seq, it will generate something like {:ColumnName "Column1"}, is there is simple way to convert all the values into lower caes in the map (which is also the attribute value)



xml-content (->>(xml/parse file)
(tree-seq :content :content))

No comments:

Post a Comment