Clojure wrapper around Java Rome tools. https://github.com/igrishaev/remus
Rome options:
lenient
: a boolean flag which makes Rome to be more tolerant
to some mistakes in XML markup;
encoding
: a string representing an encoding of the feed.
When parsing a URL, it comes from the Content-Encoding
HTTP header.
Possible values are listed here:
https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
content-type
: a string meaning the MIME type of the feed, e.g. application/rss
or something. When parsing a URL, it comes from the Content-Type
header.
:allow-doctypes
: a boolean flag, if true, allows parsing feeds containing
DOCTYPE declarations (normally disallowed).
Clojure wrapper around Java Rome tools. https://github.com/igrishaev/remus Rome options: - `lenient`: a boolean flag which makes Rome to be more tolerant to some mistakes in XML markup; - `encoding`: a string representing an encoding of the feed. When parsing a URL, it comes from the `Content-Encoding` HTTP header. Possible values are listed here: https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html - `content-type`: a string meaning the MIME type of the feed, e.g. `application/rss` or something. When parsing a URL, it comes from the `Content-Type` header. - `:allow-doctypes`: a boolean flag, if true, allows parsing feeds containing DOCTYPE declarations (normally disallowed).
(parse src)
(parse src opt-rome)
Parse a feed from any find of a source: a file, an input stream, a reader, a URL and so on. Internally, the source gets coerced to the input stream.
Parse a feed from any find of a source: a file, an input stream, a reader, a URL and so on. Internally, the source gets coerced to the input stream.
(parse-file path & [opt-rome])
Parse a file by its text path. A legacy
wrapper on top of the parse
function.
Parse a file by its text path. A legacy wrapper on top of the `parse` function.
(parse-http-resp http-resp & [opt-rome])
Parse a response produced by an HTTP client. Most
of the Rome flags come from the HTTP headers, but
you may redefine them using the opt-rome
map.
Parse a response produced by an HTTP client. Most of the Rome flags come from the HTTP headers, but you may redefine them using the `opt-rome` map.
(parse-stream stream & [opt-rome])
Parse an input stream. A legacy wrapper
on top of the parse
function.
Parse an input stream. A legacy wrapper on top of the `parse` function.
(parse-url url & [opt-http opt-rome])
Parse feed from a URL. Return a map of the :response
and :feed
keys so you can access the response, e.g.
to save some of the headers.
The feed will only be parsed when the HTTP status is 200
and the content type is XML-friendly (see possible values
in the remus.http
namespace).
The opt-http
parameter is a map of http-specific options
which gets merged with the defaults.
Parse feed from a URL. Return a map of the `:response` and `:feed` keys so you can access the response, e.g. to save some of the headers. The feed will only be parsed when the HTTP status is 200 and the content type is XML-friendly (see possible values in the `remus.http` namespace). The `opt-http` parameter is a map of http-specific options which gets merged with the defaults.
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 |