xander.core

->cxml

(->cxml x)
Converts source XML file x or raw string XML x to interim Clojure XML representation.

->input-stream

(->input-stream x)
Coverts x to a string and then into an input stream.

->kw

(->kw x)
Convert x to keyword.

->smart-external-value

(->smart-external-value v)

->str

(->str x)
Converts x to string.

->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.

all-func-key

attrs-key

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)

default-outer-tag

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.

generate-transform-field-funcs

(generate-transform-field-funcs ffm)
Generates transform fields funcs by inversing the value list as keys.

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.

normalize-keys-to-transform-funcs

(normalize-keys-to-transform-funcs m)
Converts a transform map m with keys of transform function and
keys of lists of associated field keys to new map with
keys of field keys and value of associated transform function.

outer-tag

parse-and-transform-elements

(parse-and-transform-elements tf x & [delim])

parse-elements

(parse-elements x & [delim])

safe->kw

safe-code->kw

safe-date

safe-double

safe-flag

safe-long

safe-millis-date

safe-parse-double-elements

safe-parse-elements

safe-parse-flag-elements

safe-parse-kw-elements

safe-parse-long-elements

safe-passthru

(safe-passthru f x)
Applies function f to x.  If an exception occurs during f application, returns x.

safe-slash-date

safe-start-date

safe-stop-date

sdf-stop-unix

sdf-unix

sdf-unix-millis

sdf-us-slash-date

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.

tag-value-key

thread-fs

(thread-fs fs x)
Composes and applies functions fs to seed argument x in order of fs left-to-right.

transform-field

(transform-field k v tfm)
Transforms value given a key k to lookup up transform function in map tff.

transform-keys

(transform-keys fs m)
Transforms key of map (recursively) given a list of functions fs.

transform-map-fields

(transform-map-fields m tfm)
Transforms map fields given a map with field as keys and function as value.

transform-value

(transform-value tfm k v)
Transforms the key-value k v pair given the transform function map tfm.
tfm: key=k value=transform-function

transform-values

(transform-values tfm m)
Transform the values of map m given a transform function map tfm.
tfm: key=map-key value=transform-function

trim-content

(trim-content m)
Trims the text content of an Clojure XML map m for extraneous white space.

unix-date-millis-pattern

unix-date-only-start-suffix-pattern

unix-date-only-stop-suffix-pattern

unix-date-pattern

unix-date-stop-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.