From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jakub Jankiewicz Newsgroups: gmane.lisp.guile.user Subject: Re: How to render raw data using sxml? Date: Tue, 12 Jul 2016 22:23:20 +0200 Message-ID: <20160712222320.76ce7254@jcubic> References: <20160710215849.455f55fa@jcubic> <20160712222030.04b5218f@jcubic> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1468355258 24161 80.91.229.3 (12 Jul 2016 20:27:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Jul 2016 20:27:38 +0000 (UTC) Cc: guile-user@gnu.org To: Amirouche Boubekki Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jul 12 22:27:29 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bN4H9-0001G8-8M for guile-user@m.gmane.org; Tue, 12 Jul 2016 22:27:27 +0200 Original-Received: from localhost ([::1]:43253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN4H8-0007AI-HZ for guile-user@m.gmane.org; Tue, 12 Jul 2016 16:27:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN4DH-0003nM-Ss for guile-user@gnu.org; Tue, 12 Jul 2016 16:23:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bN4DB-0000yc-RZ for guile-user@gnu.org; Tue, 12 Jul 2016 16:23:26 -0400 Original-Received: from n111.domenomania.pl ([144.76.86.235]:38713 helo=mx3.n111.domenomania.pl) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN4DB-0000yY-Kf for guile-user@gnu.org; Tue, 12 Jul 2016 16:23:21 -0400 Original-Received: from [91.239.251.231] (helo=jcubic) by n111.domenomania.pl with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1bN4DA-000VeC-DF; Tue, 12 Jul 2016 22:23:20 +0200 In-Reply-To: <20160712222030.04b5218f@jcubic> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 144.76.86.235 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12737 Archived-At: On Tue, 12 Jul 2016 22:20:30 +0200 Jakub Jankiewicz wrote: > Hi, >=20 > On Mon, 11 Jul 2016 22:58:32 +0200 > Amirouche Boubekki wrote: >=20 > > H=C3=A9llo Jakub, > >=20 > > On 2016-07-10 21:58, Jakub Jankiewicz wrote: =20 > > > Hi, > > >=20 > > > I want to render scheme code inside script tag to be executed by=20 > > > biwascheme > > > in the browser so I've try to create simple page using sxml (cgi=20 > > > script): > > >=20 > > > (sxml->xml `(html > > > (head > > > (title "BiwaScheme test") > > > (script (@ (src "biwascheme-min.js")) "(display=20 > > > \"hello\")")) > > > (body (p "BiwaScheme test")))) > > > =20 > >=20 > > This is sxml to *xml*. The correct procedure you have to use > > is `sxml->html' which can be found in haunt code [1]. Basically > > it takes care of auto-closing tags like
... and doing more > > escaping... > >=20 > > That said it has the same issue with script tag! > >=20 > > I attached a fixed version of html.scm which works in the case where > > `script' has a single element as body... > >=20 > > Here is an example: > > =20 > > >>> (sxml->html-string '(html (head (script (@ (lang "biwascheme"))=20 > > >>> "load(app.scm)")) (body (h1 "h=C3=A9llo") "world"))) =20 > > $1 =3D

hllo

wor= ld =20 > >=20 > > Biwascheme is super nice! Do you plan to work with a particular > > javascript library? > >=20 > > HTH! > >=20 > > [1] https://git.dthompson.us/haunt.git/blob_plain/HEAD:/haunt/html.scm > > =20 >=20 > I've included the lib using: >=20 > (load "html.scm") > (use-modules (haunt html)) >=20 > but when I run the code I still have " instead of ": >=20 > (sxml->html `(html > (head > (title "BiwaScheme test") > (script (@ (src "biwascheme-min.js")) "(display > \"hello\")")) (body (p "BiwaScheme test")))) >=20 > BiwaScheme test

BiwaScheme test

>=20 > PS: I plan to use jQuery, I already have binding for biwascheme: > http://terminal.jcubic.pl/js/jqbiwa.js but it don't have Ajax functions or > deferreds in it, I need to update it. >=20 >=20 > -- > Jakub Jankiewicz, Web Developer > http://jcubic.pl I've commented out (#\" . "quot") in alist->hash-table and it work. thanks for your help. -- Jakub Jankiewicz, Web Developer http://jcubic.pl