A bunch of utility functions for xml documents
A bunch of utility functions for xml documents
(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->xml-str edn)(edn->xml-str edn {:keys [:encoding :doctype] :as opts})Transform an EDN data structure into an XML string via 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
It also surfaces the original options from clojure.data.xml/emit-str
encoding - The character encoding to use
doctype - The DOCTYPE declaration to use
Transform an EDN data structure into an XML string via `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 It also surfaces the original options from `clojure.data.xml/emit-str` encoding - The character encoding to use doctype - The DOCTYPE declaration to use
(edn->xml-stream edn java-writer)(edn->xml-stream edn java-writer {:keys [:encoding :doctype] :as opts})Transform an EDN data structure into XML and stream is out via 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
It also surfaces the original options from clojure.data.xml/emit
encoding - The character encoding to use
doctype - The DOCTYPE declaration to use
Transform an EDN data structure into XML and stream is out via `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 It also surfaces the original options from `clojure.data.xml/emit` encoding - The character encoding to use doctype - The DOCTYPE declaration to use
(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
(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-source->edn xml-source)(xml-source->edn xml-source {:keys [:include-node? :location-info] :as opts})Parse an XML document source with clojure.xml/parse and transform it into normalized EDN.
xml-source may be an instance of java.io.InputStream or java.io.Reader
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
It also surfaces the original options from clojure.data.xml/parse
include-node? - a subset of #{:element :characters :comment} default #{:element :characters}
location-info - pass false to skip generating location meta data
Parse an XML document source with `clojure.xml/parse` and transform it into normalized EDN.
`xml-source` may be an instance of java.io.InputStream or java.io.Reader
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
It also surfaces the original options from `clojure.data.xml/parse`
include-node? - a subset of #{:element :characters :comment} default #{:element :characters}
location-info - pass false to skip generating location meta data(xml-str->edn xml-str)(xml-str->edn xml-str {:keys [:include-node? :location-info] :as opts})Parse an XML document with clojure.xml/parse-str 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
It also surfaces the original options from clojure.data.xml/parse-str
include-node? - a subset of #{:element :characters :comment} default #{:element :characters}
location-info - pass false to skip generating location meta data
Parse an XML document with `clojure.xml/parse-str` 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
It also surfaces the original options from `clojure.data.xml/parse-str`
include-node? - a subset of #{:element :characters :comment} default #{:element :characters}
location-info - pass false to skip generating location meta datacljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |