[PRL] Re: prl page

Felix S Klock II pnkfelix at ccs.neu.edu
Mon Jun 28 09:37:50 EDT 2004


Also, in case you're interested in reading in other people's webpages 
and then munging that content using Scheme functions...

Neil Van Dyke wrote some code for parsing HTML and returning an 
SXML-form for the parsed webpage.
See:
http://www.neilvandyke.org/htmlprag/

and I wrote a wrapper module for MzScheme that turns the SXML-form into 
a MzScheme-style X-expression.
See:
http://www.pnkfx.org/~pnkfelix/CodePost/links/Dev/scheme/code/vandyke/
(note that the latter is not complete; it uses the (INCLUDE ...) form 
to "link" Neil's htmlprag.scm file)

-Felix

On Jun 27, 2004, at 10:40 PM, Dave Herman wrote:

>> - If I use DrScheme, can I make a web page by writing some
>> S-expressions rather than raw html?
>
> I thought you'd never ask! :)
>
> I write some of my web pages as S-expressions using PLT Scheme. I 
> believe Matthias does, too.
>
> You have several options, because there is more than one 
> implementation of XML and HTML as S-expressions. PLT Scheme comes with 
> the "xml" and "html" collections, but Oleg Kiselyov also has some neat 
> libraries called SSAX, which includes an XML-as-sexps library called 
> SXML, and a transformation library that does pattern matching on SXML 
> trees and works kind of like macros.
>
>     SSAX home page:
>     http://ssax.sourceforge.net/
>
>     PLT port of SSAX:
>     http://www196.pair.com/lisovsky/xml/ssax/
>
> The reason I like using this library is because for each page (or set 
> of similar pages) I design a little data language that best fits that 
> particular design, and then I write a transformer to convert the page 
> into SXML. (Then the libraries can convert it to XHTML.)
>
>> - Assuming the answer is yes, could you please tell me how to do it?
>> I would appriciate if you could give me a sample file, how to compile
>> it into html (on Macintosh), which part of the document (in DrScheme
>> manual?)  I should read, and how to include the message "powered by
>> DrScheme."
>
> I really need to package my libraries up, update them to work with the 
> latest version of SSAX, and write some HOWTOs (i.e., exactly what 
> you're asking for). I will try to do this soon, and I'll let you know 
> when I do.
>
> Meanwhile, if you want to look at how my pages currently work, have a 
> look at:
>
>     The little libraries I've written:
>     ~dherman/.www/source/transform.ss
>     ~dherman/.www/source/www.ss
>
>     The sources for a couple of my web pages:
>     ~dherman/.www/source/index.sxml
>     ~dherman/.www/source/code.sxml
>
>     The scripts that generate the XHTML output:
>     ~dherman/.www/source/index.scm
>     ~dherman/.www/source/code.scm
>
> (There's a readme in that directory but it's completely outdated.) As 
> I said, some pieces are kind of hacked together. Undoubtedly it's not 
> all self-explanatory, so let me know if you have any questions.
>
> Dave
>
>
> _______________________________________________
> PRL mailing list
> PRL at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/prl
>

----
"Go, go, gadget compilation."  -cananian




More information about the PRL mailing list