Liking cljdoc? Tell your friends :D

clj-xml.core

A bunch of utility functions for xml documents

A bunch of utility functions for xml documents
raw docstring

edn->xmlclj

(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->xml-strclj

(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
sourceraw docstring

edn->xml-streamclj

(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
sourceraw docstring

edn-map->xmlclj

(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

(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

xml->ednclj

(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 remove-empty-attrs? - to remove any empty attribute maps

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
  remove-empty-attrs? - to remove any empty attribute maps
sourceraw docstring

xml-map->ednclj

(xml-map->edn xml-map)
(xml-map->edn {:keys [tag attrs content]}
              {:keys [preserve-keys? preserve-attrs? stringify-values?
                      remove-empty-attrs?]
               :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 stringify-values? - to coerce non-nil, non-string, non-collection values to strings remove-empty-attrs? - to remove any empty attribute maps

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
  stringify-values? - to coerce non-nil, non-string, non-collection values to strings
  remove-empty-attrs? - to remove any empty attribute maps
sourceraw docstring

xml-seq->ednclj

(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 stringify-values? - to coerce non-nil, non-string, non-collection values to strings remove-empty-attrs? - to remove any empty attribute maps

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
  stringify-values? - to coerce non-nil, non-string, non-collection values to strings
  remove-empty-attrs? - to remove any empty attribute maps
sourceraw docstring

xml-source->ednclj

(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 remove-empty-attrs? - to remove any empty attribute maps

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
  remove-empty-attrs? - to remove any empty attribute maps

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
sourceraw docstring

xml-str->ednclj

(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 remove-empty-attrs? - to remove any empty attribute maps

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
  remove-empty-attrs? - to remove any empty attribute maps

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
sourceraw docstring

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

× close