[Lispweb] mod_lisp ?

Sunil Mishra sunil.mishra at everest.com
Tue Jul 18 14:28:35 CDT 2000

[snipped, as Vladimir has given a great response to the standards issue

> The problem could be solved by some sort of convention but arbritary
> conventions are what I am trying to avoid  /8->

I think XML provides many, many opportunities that we have not yet explored.
To name a few,

* Namespaces (one for the markup)
* XPATH (separation of code and data)
* CDATA sections with well defined semantics

To elaborate, namespaces can allow us to include lisp code through tags that
do not interfere with the rest of the document. We can introduce tags and
attributes as needed. Well, *almost*. If the document relies on a schema for
correct parsing then we may have to modify the schema. But it does result in
something that is a lot cleaner than anything we have now.

We can further reduce the tag clutter through the use of XPATH. My guess is
that all we would need is to make the XML document subservient to an
*external* lisp program. The lisp program could refer to specific parts of
the XML document, to either turn into code as needed. Or perhaps to
introduce specific modifications, such as an attribute value, into the XML
document. Or perhaps replace an XML document component with something that
is dynamically generated. This would allow designers to work on document
presentation, and for programmers to modify the content as needed.

And for situations where the separation of code and XML is not required or
desired, one can always fall back on markup to introduce code. Which along
with CDATA sections should make the process relatively painless.

I'd imagine the content generation then to work something like this:

(with-xpath-reference (<the element reference>)
  (add-attribute-value ...))

Or perhaps

(with-xpath-reference (<the element reference>)
  (replace-element ...))

And so on. This could obviously be done in any language, but only in lisp
could you take the XML document and easily turn it into reusable code :-)


PS: Anyone here that may have thought of a good use for XSLT?

More information about the lispweb mailing list