Liking cljdoc? Tell your friends :D

nnichols.xml

A bunch of utility functions for xml documents

A bunch of utility functions for xml documents
raw docstring

attrs-lengthclj/s

source

attrs-tag->tagclj/s

(attrs-tag->tag attrs-tag)

Remove a suffix of -attrs/_ATTRS from attrs-tag

Remove a suffix of `-attrs/_ATTRS` from `attrs-tag`
sourceraw docstring

edn->xmlclj/s

(edn->xml edn)
(edn->xml edn {:keys [stringify-values?] :as opts})

Transform an EDN data structure to the pseudo XML expected by clojure.data.xml. To change the default behavior, an option map may be provided with the following keys: to-xml-case? - To modify the keys representing XML tags to XML_CASE from-xml-case? - If the source EDN has XML_CASE keys stringify-values? - to coerce non-nil, non-string, non-collection values to strings

Transform an EDN data structure to the pseudo XML expected by `clojure.data.xml`.
To change the default behavior, an option map may be provided with the following keys:
to-xml-case? - To modify the keys representing XML tags to XML_CASE
from-xml-case? - If the source EDN has XML_CASE keys
stringify-values? - to coerce non-nil, non-string, non-collection values to strings
sourceraw docstring

edn-attrs-tag?clj/s

(edn-attrs-tag? tag all-tags)

Returns true iff the list of all-tags to see if it contains the normalized tag

Returns true iff the list of `all-tags` to see if it contains the normalized `tag`
sourceraw docstring

edn-map->xmlclj/s

(edn-map->xml edn)
(edn-map->xml edn
              {:keys [to-xml-case? from-xml-case? stringify-values?] :as opts})

Transform an EDN map to the pseudo XML expected by clojure.data.xml. To change the default behavior, an option map may be provided with the following keys: to-xml-case? - To modify the keys representing XML tags to XML_CASE from-xml-case? - If the source EDN has XML_CASE keys stringify-values? - to coerce non-nil, non-string, non-collection values to strings

Transform an EDN map to the pseudo XML expected by `clojure.data.xml`.
To change the default behavior, an option map may be provided with the following keys:
to-xml-case? - To modify the keys representing XML tags to XML_CASE
from-xml-case? - If the source EDN has XML_CASE keys
stringify-values? - to coerce non-nil, non-string, non-collection values to strings
sourceraw docstring

edn-seq->xmlclj/s

(edn-seq->xml edn)
(edn-seq->xml edn opts)

Transform an EDN sequence to the pseudo XML expected by clojure.data.xml. To change the default behavior, an option map may be provided with the following keys: to-xml-case? - To modify the keys representing XML tags to XML_CASE from-xml-case? - If the source EDN has XML_CASE keys stringify-values? - to coerce non-nil, non-string, non-collection values to strings

Transform an EDN sequence to the pseudo XML expected by `clojure.data.xml`.
To change the default behavior, an option map may be provided with the following keys:
to-xml-case? - To modify the keys representing XML tags to XML_CASE
from-xml-case? - If the source EDN has XML_CASE keys
stringify-values? - to coerce non-nil, non-string, non-collection values to strings
sourceraw docstring

keyword->xml-tagclj/s

(keyword->xml-tag edn-keyword)

Take a clojure keyord and turn it into the form expected by clojure.data.xml by making it UPPER CASE and snake_cased

Take a clojure keyord and turn it into the form expected by `clojure.data.xml` by making it UPPER CASE and snake_cased
sourceraw docstring

tag->attrs-tagclj/s

(tag->attrs-tag tag upper-case?)

Transform tag to look like an attributes map tag by appending it with -attrs/_ATTRS pedending on the value of upper-case?

Transform `tag` to look like an attributes map tag by appending it with `-attrs/_ATTRS` pedending on the value of `upper-case?`
sourceraw docstring

unique-tags?clj/s

(unique-tags? xml-seq)

Take an XML sequence as formatted by clojure.xml/parse, and determine if it exclusively contains unique tags

Take an XML sequence as formatted by `clojure.xml/parse`, and determine if it exclusively contains unique tags
sourceraw docstring

xml->ednclj/s

(xml->edn xml-doc)
(xml->edn xml-doc {:keys [stringify-values?] :as opts})

Transform an XML document as formatted by clojure.xml/parse, and transform it into normalized EDN. By default, this also mutates keys from XML_CASE to lisp-case and ignores XML attributes within tags. To change this behavior, an option map may be provided with the following keys: preserve-keys? - to maintain the exact keyword structure provided by clojure.xml/parse preserve-attrs? - to maintain embedded XML attributes stringify-values? - to coerce non-nil, non-string, non-collection values to strings

Transform an XML document as formatted by `clojure.xml/parse`, and transform it into normalized EDN.
By default, this also mutates keys from XML_CASE to lisp-case and ignores XML attributes within tags.
To change this behavior, an option map may be provided with the following keys:
preserve-keys? - to maintain the exact keyword structure provided by `clojure.xml/parse`
preserve-attrs? - to maintain embedded XML attributes
stringify-values? - to coerce non-nil, non-string, non-collection values to strings
sourceraw docstring

xml-map->ednclj/s

(xml-map->edn xml-map)
(xml-map->edn {:keys [tag attrs content]}
              {:keys [preserve-keys? preserve-attrs? stringify-values?]
               :as opts})

Transform an XML map as formatted by clojure.xml/parse, and transform it into normalized EDN. By default, this also mutates keys from XML_CASE to lisp-case and ignores XML attributes within tags. To change this behavior, an option map be provided with the following keys: preserve-keys? - to maintain the exact keyword structure provided by clojure.xml/parse preserve-attrs? - to maintain embedded XML attributes

Transform an XML map as formatted by `clojure.xml/parse`, and transform it into normalized EDN.
By default, this also mutates keys from XML_CASE to lisp-case and ignores XML attributes within tags.
To change this behavior, an option map be provided with the following keys:
preserve-keys? - to maintain the exact keyword structure provided by `clojure.xml/parse`
preserve-attrs? - to maintain embedded XML attributes
sourceraw docstring

xml-seq->ednclj/s

(xml-seq->edn xml-seq)
(xml-seq->edn xml-seq opts)

Transform an XML sequence as formatted by clojure.xml/parse, and transform it into normalized EDN. By default, this also mutates keys from XML_CASE to lisp-case and ignores XML attributes within tags. To change this behavior, an option map be provided with the following keys: preserve-keys? - to maintain the exact keyword structure provided by clojure.xml/parse preserve-attrs? - to maintain embedded XML attributes

Transform an XML sequence as formatted by `clojure.xml/parse`, and transform it into normalized EDN.
By default, this also mutates keys from XML_CASE to lisp-case and ignores XML attributes within tags.
To change this behavior, an option map be provided with the following keys:
preserve-keys? - to maintain the exact keyword structure provided by `clojure.xml/parse`
preserve-attrs? - to maintain embedded XML attributes
sourceraw docstring

xml-tag->keywordclj/s

(xml-tag->keyword xml-tag)

Take an XML tag as extracted by clojure.data.xml and turn it into a kebab-cased, lower case keyword

Take an XML tag as extracted by `clojure.data.xml` and turn it into a kebab-cased, lower case keyword
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close