- atom:content record
- content? procedure
- (content-kind C) procedure
- (content-type C) procedure
- (content-source C) procedure
- (content-text C) procedure
- (content-xhtml C) procedure
- (content-xml C) procedure
- (content-contents C) procedure
Predicate and accessors for atom:content elements, which represent feed or entry content.
Atom content types may be one of "text", "html", "xhtml", or any valid MIME type; further, the structure and meaning of the content itself depends on the MIME type. To simplify this, we normalize the MIME type and we categorize it by kind:
- The indicated MIME media type of the contents. If the type in the source document is text, html, or xhtml, we normalize this to text/plain, text/html, or application/xhtml+xml respectively. If no type is explicitly indicated, it defaults to text/plain.
- The computed "kind" of the contents, as a symbol. This determines how you should handle the content.
kind may be one of the following symbols, which represent
- plain text (text/plain), the default
- HTML text (text/html)
- an XHTML div element (application/xhtml+xml)
- XML; any MIME type string ending with /xml or +xml, or one of the RFC3023 XML media types
- text data; any other MIME type starting with text/
- base64-encoded binary data; any other MIME type other than those mentioned above
- external data pointed to by a URI
To obtain the content, you should use the proper accessor based on the kind:
- content-text, returning a string (or empty string, if no content)
- content-text, returning an unescaped HTML string (or empty string)
- content-xhtml, returning the XHTML div element as SXML, or #f
- content-xml, returning the root element (whatever it is) as SXML, or #f [*]
- content-text, returning a string (or empty string)
- content-text, returning a base64-encoded string; use base64 to decode it
- content-source, returning the external URI as a string, or #f
[*] XML contents conventionally consist of a single root element with no siblings, which is returned directly as (node ...). If more than one such element is found, they are all returned wrapped in a *TOP* node, like (*TOP* (node1 ...) (node2 ...) ...).
For xml, textual, binary and external kinds, you will then need to refer to the content media type to actually process it.
And finally the raw content accessor, just in case:
- Contents of the atom:contents element as a raw list of nodes. Does not try to process the content.