A bunch of utility functions for xml documents
A bunch of utility functions for xml documents
(attrs-tag->tag attrs-tag)
Remove a suffix of -attrs/_ATTRS
from attrs-tag
Remove a suffix of `-attrs/_ATTRS` from `attrs-tag`
(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
(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`
(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
(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
(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
(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?`
(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
(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
(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
(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
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close