Liking cljdoc? Tell your friends :D

clojure.data.xml

Functions to parse XML into lazy sequences and lazy trees and emit these as text.

Functions to parse XML into lazy sequences and lazy trees and
emit these as text.
raw docstring

aggregate-xmlnsclj

(aggregate-xmlns xml)

Put all occurring xmlns into the root

Put all occurring xmlns into the root
sourceraw docstring

alias-nsclj

(alias-ns & {:as alias-nss})

Define a clojure namespace alias for shortened keyword and symbol namespaces. Similar to clojure.core/alias, but if namespace doesn't exist, it is created.

Example

(declare-ns :xml.dav "DAV:") (alias-ns :D :xml.dav) {:tag ::D/propfind :content []}

Define a clojure namespace alias for shortened keyword and symbol namespaces.
 Similar to clojure.core/alias, but if namespace doesn't exist, it is created.

 ## Example
 (declare-ns :xml.dav "DAV:")
 (alias-ns :D :xml.dav)
{:tag ::D/propfind :content []}
sourceraw docstring

canonical-nameclj

(canonical-name n)

Put (q)name into canonical form as per ns-env

Put (q)name into canonical form as per ns-env
sourceraw docstring

cdataclj

(cdata content)

Create a CData node

Create a CData node
sourceraw docstring

declare-nsclj

(declare-ns & {:as cljns-xmlnss})

Define mappings in the global keyword-ns -> qname-uri mapping table. Arguments are pairs of ns-name - qname-uri ns-name must be a string, symbol, keyword or clojure namespace. The canonical form is string. ns-uri must be a string

Define mappings in the global keyword-ns -> qname-uri mapping table.
Arguments are pairs of ns-name - qname-uri
ns-name must be a string, symbol, keyword or clojure namespace. The canonical form is string.
ns-uri must be a string
sourceraw docstring

elementclj

(element tag)
(element tag attrs)
(element tag attrs & content)

Create an xml Element from content varargs

Create an xml Element from content varargs
sourceraw docstring

element*clj

(element* tag attrs content)
(element* tag attrs content meta)

Create an xml element from a content collection and optional metadata

Create an xml element from a content collection and optional metadata
sourceraw docstring

element-nssclj

(element-nss {:keys [attrs] :as element})

Get xmlns environment from element

Get xmlns environment from element
sourceraw docstring

emitclj

(emit e writer & {:as opts})

Prints the given Element tree as XML text to stream. Options: :encoding <str> Character encoding to use

Prints the given Element tree as XML text to stream.
Options:
 :encoding <str>          Character encoding to use
sourceraw docstring

emit-strclj

(emit-str e & opts)

Emits the Element to String and returns it

Emits the Element to String and returns it
sourceraw docstring

event-seqclj

(event-seq source {:as props})

Parses the XML InputSource source using a pull-parser. Returns a lazy sequence of Event records. Accepts key pairs with XMLInputFactory options, see http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html and xml-input-factory-props for more information. Defaults coalescing true and supporting-external-entities false. :include-node? can be a set of #{:start-element :end-element :characters :comment}

Parses the XML InputSource source using a pull-parser. Returns
a lazy sequence of Event records.  Accepts key pairs
with XMLInputFactory options, see http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html
and xml-input-factory-props for more information.
Defaults coalescing true and supporting-external-entities false.
:include-node? can be a set of #{:start-element :end-element :characters :comment}
sourceraw docstring

find-xmlnsclj

(find-xmlns xml)

Find all xmlns occuring in a root

Find all xmlns occuring in a root
sourceraw docstring

indentclj

(indent e writer & opts)

Emits the XML and indents the result. WARNING: this is slow it will emit the XML and read it in again to indent it. Intended for debugging/testing only.

Emits the XML and indents the result.  WARNING: this is slow
it will emit the XML and read it in again to indent it.  Intended for
debugging/testing only.
sourceraw docstring

indent-strclj

(indent-str e & opts)

Emits the XML and indents the result. Writes the results to a String and returns it

Emits the XML and indents the result.  Writes the results to a String and returns it
sourceraw docstring

ns-uriclj

(ns-uri ns)

Look up xmlns uri to keyword namespace

Look up xmlns uri to keyword namespace
sourceraw docstring

parseclj

(parse source & opts)

Parses the source, which can be an InputStream or Reader, and returns a lazy tree of Element records. Accepts key pairs with XMLInputFactory options, see http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html and xml-input-factory-props for more information. Defaults coalescing true.

Parses the source, which can be an
InputStream or Reader, and returns a lazy tree of Element records. Accepts key pairs
with XMLInputFactory options, see http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html
and xml-input-factory-props for more information. Defaults coalescing true.
sourceraw docstring

parse-qnameclj

source

parse-strclj

(parse-str s & opts)

Parses the passed in string to Clojure data structures. Accepts key pairs with XMLInputFactory options, see http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html and xml-input-factory-props for more information. Defaults coalescing true.

Parses the passed in string to Clojure data structures.  Accepts key pairs
with XMLInputFactory options, see http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html
and xml-input-factory-props for more information. Defaults coalescing true.
sourceraw docstring

qnameclj

(qname name)
(qname uri name)
(qname uri name prefix)
source

qname-localclj

(qname-local qname)

Get the name for this qname

Get the name for this qname
sourceraw docstring

qname-uriclj

(qname-uri qname)

Get the namespace uri for this qname

Get the namespace uri for this qname
sourceraw docstring

sexp-as-elementclj

(sexp-as-element sexp)

Convert a single sexp into an Element

Convert a single sexp into an Element
sourceraw docstring

sexps-as-fragmentclj

(sexps-as-fragment)
(sexps-as-fragment sexp)
(sexps-as-fragment sexp & sexps)

Convert a compact prxml/hiccup-style data structure into the more formal tag/attrs/content format. A seq of elements will be returned, which may not be suitable for immediate use as there is no root element. See also sexp-as-element.

The format is [:tag-name attr-map? content*]. Each vector opens a new tag; seqs do not open new tags, and are just used for inserting groups of elements into the parent tag. A bare keyword not in a vector creates an empty element.

To provide XML conversion for your own data types, extend the AsElements protocol to them.

Convert a compact prxml/hiccup-style data structure into the more formal
tag/attrs/content format. A seq of elements will be returned, which may
not be suitable for immediate use as there is no root element. See also
sexp-as-element.

The format is [:tag-name attr-map? content*]. Each vector opens a new tag;
seqs do not open new tags, and are just used for inserting groups of elements
into the parent tag. A bare keyword not in a vector creates an empty element.

To provide XML conversion for your own data types, extend the AsElements
protocol to them.
sourceraw docstring

to-qnameclj

(to-qname n)
source

uri-nsclj

(uri-ns uri)

Look up keyword namespace to xmlns uri

Look up keyword namespace to xmlns uri
sourceraw docstring

xml-commentclj

(xml-comment content)

Create a Comment node

Create a Comment node
sourceraw docstring

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

× close