Shared XML helpers for the form parsers (plain clojure.xml — no extra deps). Tag matching ignores namespace prefixes, so :infoTable matches both <infoTable> and ns1:infoTable.
Shared XML helpers for the form parsers (plain clojure.xml — no extra deps). Tag matching ignores namespace prefixes, so :infoTable matches both <infoTable> and <ns1:infoTable>.
(child node tag)First direct child element of node whose tag matches.
First *direct* child element of node whose tag matches.
(child-text node tag)Text of the first direct child element matching tag.
Text of the first direct child element matching tag.
(find-tag node tag)First descendant element (depth-first, including node itself) whose tag matches.
First descendant element (depth-first, including node itself) whose tag matches.
(find-tags node tag)All descendant elements (including node itself) whose tag matches, in document order.
All descendant elements (including node itself) whose tag matches, in document order.
(nested-text node & tags)Walk a path of tags (each a descendant search) from node and return the leaf text.
Walk a path of tags (each a descendant search) from node and return the leaf text.
(parse-double-safe s)Parse a numeric string ("1,234.5" allowed) to a double; nil for nil, blank or unparseable input.
Parse a numeric string ("1,234.5" allowed) to a double; nil for nil,
blank or unparseable input.(parse-long-safe s)Parse an integer string ("1,234" allowed) to a long; nil for nil, blank or unparseable input.
Parse an integer string ("1,234" allowed) to a long; nil for nil,
blank or unparseable input.(parse-str s)Parse an XML string into a clojure.xml element tree.
Parse an XML string into a clojure.xml element tree.
(tag-matches? tag node-tag)True when node-tag is tag, ignoring any namespace prefix on node-tag.
True when node-tag is tag, ignoring any namespace prefix on node-tag.
(tag-text node & tags)Text of the first descendant matching any of the given tags, tried in order (schemas sometimes spell one field several ways).
Text of the first descendant matching any of the given tags, tried in order (schemas sometimes spell one field several ways).
(text node)Trimmed text content of an element, or nil when empty.
Trimmed text content of an element, or nil when empty.
(texts node tag)Trimmed texts of every descendant element matching tag (repeated tags such as typeOfReportingPerson), in document order; [] when there are none.
Trimmed texts of every descendant element matching tag (repeated tags such as typeOfReportingPerson), in document order; [] when there are none.
(xml-documents files)The entries of a filing index's :files that can hold form data: names ending in .xml, minus XBRL documents (inline-XBRL instances *_htm.xml, EX-101 attachments, or any document typed XBRL).
The entries of a filing index's :files that can hold form data: names ending in .xml, minus XBRL documents (inline-XBRL instances *_htm.xml, EX-101 attachments, or any document typed XBRL).
cljdoc 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 |