html prefix names a special namespace
(see Namespaces) of functions to create HTML element nodes.
html:em is a constructor that
when called creates a element node whose tag is
If this element node is formatted as HTML, the
result has an
Creates an element node whose tag is tag.
The parameters are first zero or more attributes, followed
by zero of more child values.
An attribute is either an attribute value (possibly
make-attribute), or a pair of arguments:
A keyword followed by the attribute value.
Child values are usually either strings (text content),
or nested element nodes, but can also be comment or processing-instruction
(html:a href: "http://gnu.org/" "the "(html:i "GNU")" homepage")
The compound identifier
html:tag is actually
a type: When you call it as a function you’re using Kawa’s
standard coercion of a type to its constructor function.
This means you can do type tests:
(define some-node ...) (if (instance? some-node html:blink) (error "blinking not allowed!"))
Object identity is currently not fully specified. Specifically, it is undefined if a nested (child) element node is copied “by value” or “by reference”. This is related to whether nodes have a parent reference. In the XPath/XQuery data model nodes do have a parent reference, and child nodes are conceptually copied. (In the actual implemention copying is commonly avoided.) Kawa/Scheme currently followed the XQuery copying semantics, which may not be the most appropriate for Scheme.