xander.core
->cxml
(->cxml x)
Converts source XML file x or raw string XML x to interim Clojure XML representation.
->smart-external-value
(->smart-external-value v)
->tag-content
(->tag-content t c & [am ts])
Converts tag t to content c given optional attribute map am.
->xml-element-str
(->xml-element-str cxml)
Convert Clojure XML-compliant map cxml to elements and then returns an indented
formatted XML string.
->xml-str
(->xml-str cxml)
Converts an XML-compliant map to an XML string representation.
<-attrs
(<-attrs am ts & [default])
Extracts attribute keys of a tag location ts from attributes map am.
<-flatten-tag-value
(<-flatten-tag-value m)
Extracts tagged value (if any) from map m.
conjv
(conjv c x)
Conjoins x to c, defaults conjoing on an empty vector if c is nil.
cxml->attrs-cxml
(cxml->attrs-cxml cxml & [am ts])
Converts Clojure XML-compliant map to XML-compliant map with attributes pulled
into attributes map of tag using attribute mapping am and tag location ts.
cxml->elements
(cxml->elements cxmap)
Converts a Clojure XML-compliant map cxmap to a Clojure Data XML element map.
cxml->map
(cxml->map xm & [tff suppress-outer-tag? unsorted?])
Converts standard Clojure XML conversion map to more idiomatic Clojure map with
optional field transform function map tff and suppress outer XML tag flag.
Sacrifices unassisted round-trip XML fidelity for more idiomatic Clojure map
with minimal XML structure artifacts (attributes, content, et al)
flatten-tag-values
(flatten-tag-values x)
Flattens tagged values from intermediate aggregation map from parse Clojure map with tag values.
flatten-tagged-map
(flatten-tagged-map m)
Flattens tagged map m with intermediate aggregation from parsed Clojure map with tag values.
kebab-keys
Transforms map keys into Clojure kebab-keys.
lvs?
(lvs? x)
Determines if x is a vector, list, set, or seq.
map->cxml
(map->cxml cm & [am tag ts])
Converts a standard Clojure map cm to an XML string representation given the top-level tag and attribute map am.
map->xml
(map->xml m & [attr-map outer-tag])
Converts a map m to an XML string with an outer tag outer-tag and
the optional arguments of an attribute map attr-map.
normalize-content
(normalize-content xm & [tff])
Normalizes content of converted XML tags.
parse-elements
(parse-elements x & [delim])
safe-parse-double-elements
safe-passthru
(safe-passthru f x)
Applies function f to x. If an exception occurs during f application, returns x.
smart-conj
(smart-conj c x)
Conjoins x to c, if c is a map, then return [c x].
tac->element
(tac->element m)
Converts a simple Clojure XML map with :tag, :attrs, and :content
to Clojure Data XML element.
thread-fs
(thread-fs fs x)
Composes and applies functions fs to seed argument x in order of fs left-to-right.
trim-content
(trim-content m)
Trims the text content of an Clojure XML map m for extraneous white space.
unix-date-only-start-suffix-pattern
unix-date-only-stop-suffix-pattern
us-slash-date-only-pattern
xml->map
(xml->map xml-str & [tfm suppress-outer-tag?])
Converts an XML string xml-str to a simplified and more idiomatic Clojure map with
optional arguments to transform function map tfm and flag to
suppress outer tag.
xml->normalized-map
(xml->normalized-map xml-str & [tfm suppress-outer-tag?])
Converts an XML string xml-str to a simplified and more idiomatic Clojure map with
optional arguments to transform function map tfm and flag to
suppress outer tag.