(text sxml html-parser) - Flxible HTML parser

Library (text sxml html-parser)

This library provides HTML parser and printer procedures.

The provided procedures are compatible with HTMLPrag.

High level APIs

Parse given input port to SHTML. The in must be a textual input port.

The html->sxml-2nf procedure normalizes attributes if it doesn't have value. Others don't. Normalization in this context means adding attribute name as its value.

Writes given shtml to out.

If optional argument out is given, it must be a textual output port, then the procedure writes to given output port. Otherwise current-output-port is used.

Optional argument error-filter is used when unexpected SHTML entity is met. It must be a procedure takes 2 arguments, unexpected entity and boolean flag indicates if the entity is attribute or not. By default, it raises an error.

Converts shtml to string represented HTML.

Low level APIs

SXML entity symbols: *COMMENT*, *DECL*, *EMPTY*, *END*, *ENTITY*, *PI*, *START*, *TEXT* and *TOP* respectively.

These variables are used in *ENTITY* as public identifier.

Makes SHTML character entity. The value must be a symbol, string or integer.

(make-shtml-entity 151)
(& 151)

Retrieve SHTML entity value.