Paste number 60590: HTML Parser/Render for Core-Server

Paste number 60590: HTML Parser/Render for Core-Server
Pasted by: v0|d
5 days, 11 hours ago
None
Paste contents:
Raw Source | XML | Display As
(let ((element (dom-element?
                        (make-core-stream "<html><body><div id='content'>Loading please wait..</div></body></html>")
)
)
)

          (core-search (list element)
                       (lambda (element)
                         (if (and
                              (typep element 'dom-element)
                              (equal (cdr (assoc "id" (attributes element) :test #'equal))
                                     "content"
)
)
                     
                             (setf (children element) (list "I'm content!"))
)
)

                       #'dom-successor
                       #'append
)

          (with-html-output *core-output* element)
)

<html>
  <body>
    <div id="content">I'm content!</div></body></html>#<CORE-STANDARD-OUTPUT {1002D98F41}>

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.