Common Lisp Package: XML-EMITTER

README:

FUNCTION

Public

EMIT-SIMPLE-TAGS (&REST TAGS-PLIST)

Given a plist mapping tag names to values (or nil), emit tags in the order given, skipping ones with nil values. Tag names are downcased unless they're passed as strings.

SIMPLE-TAG (NAME CONTENT &OPTIONAL ATTRS NAMESPACE)

Emit a simple tag with given content

XML-AS-IS (X &KEY (INDENT T))

Write X to XML output, unescaped and optionally indented

XML-OUT (X &KEY (INDENT T))

Write X to XML output, escaped and optionally indented

Undocumented

RSS-CHANNEL-HEADER (TITLE LINK &KEY DESCRIPTION (LANGUAGE en-us) IMAGE IMAGE-TITLE IMAGE-LINK)

RSS-ITEM (TITLE &KEY LINK DESCRIPTION AUTHOR CATEGORY COMMENTS GUID PUBDATE SOURCE)

Private

END-TAG (NAME)

Write en ending tag to XML output

INDENT (&OPTIONAL (SPACES *INDENT*))

Indent a given number of spaces

START-TAG (NAME &OPTIONAL ATTRS NAMESPACE)

Write a start tag to XML output

WRITE-ESCAPED (STRING STREAM)

Writes string to stream with all character entities escaped.

MACRO

Public

WITH-SIMPLE-TAG ((NAME &OPTIONAL ATTRS NAMESPACE) &BODY BODY)

Like WITH-TAG, but without the linebreaks.

WITH-TAG ((NAME &OPTIONAL ATTRS NAMESPACE) &BODY BODY)

Wrap BODY in a tag. BODY is indented, and linebreaks are added.

WITH-XML-OUTPUT ((STREAM &KEY (ENCODING ISO-8859-1)) &BODY BODY)

Wrap XML output on STREAM with the necessary XML heading information

Undocumented

WITH-RSS2 ((STREAM &KEY (ENCODING ISO-8859-1)) &BODY BODY)

Private

WITH-INDENT ((&OPTIONAL (SPACES 4)) &BODY BODY)

Increase the indentation level in BODY by SPACES

VARIABLE

Private

*INDENT*

Number of spaces to indent each line of XML output

*XML-OUTPUT-STREAM*

The stream to write XML to

Undocumented

*CHAR-ESCAPES*

*ENTITIES*

*WHITESPACE*