Working with XML and HTML

Kawa has a number of features for working with XML, HTML, and generated web pages.

In Kawa you don’t write XML or HTML directly. Instead you write expressions that evaluate to “node objects” corresponding to elements, attributes, and text. You then write these node objects using either an XML or HTML format.

Many web-page-generating tools require you to work directly with raw HTML, as for example:

(display "<p>Don't use the <code>&lt;blink&gt;</code> tag.</p>")

In Kawa you would instead do:

(display (html:p "Don't use the " (html:code "<blink>") " tag."))

The conversion from node objects to XML or HTML is handled by the formatter (or serializer). Some advantages of doing it this way are: