phtml

Phtml is lisp library to parse HTML which has been open-sourced by Franz. First paragraph from the documentation:

The parse-html generic function processes HTML input, returning a list of HTML tags, attributes, and text. Here is a simple example (we have added carriage returns in the string for readability):

(parse-html "<HTML>
             <HEAD>
             <TITLE>Example HTML input</TITLE>

<BODY> <P>Here is some text with a <B>bold</B> word <br>and a <A HREF=\"help.html\">link</A></P>

</HTML>")

generates:

((:html (:head (:title "Example HTML input"))
  (:body (:p "Here is some text with a " (:b "bold") "word" :br "and a "

((:a :href "help.html") "link")))))

The output format is known as LHTML (Lisp HTML) format; it is the same format that the aserve htmlgen macro accepts. As the example shows, it is a nested collection of lists where the first element of each list is a keyword associated with an HTML marker, or a list whose first element is a keyword associated with an HTML marker and the other elements are attribute names and values. (The link is an example where the first element is a list.)

Phtml has been ASDF packaged and cleaned from ACL-specific stuff by Nick Allen. It should work in ACL and SBCL (at least).

Download ASDF package from http://common-lisp.net/project/cl-couch/phtml_1.0.tar.gz

Darcs: http://common-lisp.net/project/cl-couch/darcs/phtml


This page is presently Uncategorized: please add appropriate topic markers and remove this text

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively