xml literals

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

xml literals

Damien Mattei
hello Per,
i try to use XML literals in code and i have errors i do not have in REPL:
compiling this:
(set! html-literal-table-data-code
                              (html:td result))

where result is a string ,or even a simple code:

(html:td "foo")
i got this error in my code:
java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -C DBtoWebObserversKawa.scm
(compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
        at gnu.expr.LitTable.error(LitTable.java:103)
        at gnu.expr.LitTable.writeObject(LitTable.java:271)
        at gnu.expr.LitTable.emit(LitTable.java:66)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2433)
        at gnu.expr.Compilation.process(Compilation.java:2172)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:302)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:284)
        at kawa.repl.compileFiles(repl.java:753)
        at kawa.repl.processArgs(repl.java:434)
        at kawa.repl.main(repl.java:793)

at REPL all is ok:
 kawa --output-format html
#|kawa:1|# (html:em "hello!")
<em>hello!</em>
#|kawa:2|# (html:b "hello!")
<b>hello!</b>
#|kawa:3|# (html:td "toto")
<td>toto</td>
#|kawa:4|# (html:tr (html:td "foo") (html:td "bar"))
<tr><td>foo</td><td>bar</td></tr>
#|kawa:5|# (define toto "titi")
#|kawa:6|# (html:td toto)
<td>titi</td>

Damien
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
On 05/15/2017 07:11 AM, Damien MATTEI wrote:

> hello Per,
> i try to use XML literals in code and i have errors i do not have in REPL:
> compiling this:
> (set! html-literal-table-data-code
>      (html:td result))
>
> where result is a string ,or even a simple code:
>
> (html:td "foo")
> i got this error in my code:
> java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -C DBtoWebObserversKawa.scm
> (compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
> Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
>          at gnu.expr.LitTable.error(LitTable.java:103)
>          at gnu.expr.LitTable.writeObject(LitTable.java:271)

I'm not seeing this.

Kawa-2.1 is awfully old - however the old kawa-2.1.jar does work for me.

Perhaps you could post a complete self-contained program?
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Mattei Damien
i will try to send you the whole file in attachment,
not easy i'm using mutt and i'm a newbie with this command line mail program,
i will comment all the include file, i have tested you will get a lot of warnings but should compile anyway,
if you just uncomment the (html:td "toto") in file it should display the output error.
i try to send it in attachment in another mail...
On Mon, May 15, 2017 at 09:06:20AM -0700, Per Bothner wrote:

> On 05/15/2017 07:11 AM, Damien MATTEI wrote:
> >hello Per,
> >i try to use XML literals in code and i have errors i do not have in REPL:
> >compiling this:
> >(set! html-literal-table-data-code
> >      (html:td result))
> >
> >where result is a string ,or even a simple code:
> >
> >(html:td "foo")
> >i got this error in my code:
> >java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -C DBtoWebObserversKawa.scm
> >(compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
> >Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
> >         at gnu.expr.LitTable.error(LitTable.java:103)
> >         at gnu.expr.LitTable.writeObject(LitTable.java:271)
>
> I'm not seeing this.
>
> Kawa-2.1 is awfully old - however the old kawa-2.1.jar does work for me.
>
> Perhaps you could post a complete self-contained program?
> --
> --Per Bothner
> [hidden email]   http://per.bothner.com/

DBtoWebObserversKawa.scm (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Mattei Damien
the attachment was in the previous mail,
just compile it this way (as you have not the others preccompiled classes and included scheme files):
java -cp /usr/local/share/java/kawa-2.1.jar kawa.repl  -C DBtoWebObserversKawa.scm
do not forget to uncomment the (html:td .....)

On Mon, May 15, 2017 at 06:50:06PM +0200, Damien MATTEI wrote:

> i will try to send you the whole file in attachment,
> not easy i'm using mutt and i'm a newbie with this command line mail program,
> i will comment all the include file, i have tested you will get a lot of warnings but should compile anyway,
> if you just uncomment the (html:td "toto") in file it should display the output error.
> i try to send it in attachment in another mail...
> On Mon, May 15, 2017 at 09:06:20AM -0700, Per Bothner wrote:
> > On 05/15/2017 07:11 AM, Damien MATTEI wrote:
> > >hello Per,
> > >i try to use XML literals in code and i have errors i do not have in REPL:
> > >compiling this:
> > >(set! html-literal-table-data-code
> > >      (html:td result))
> > >
> > >where result is a string ,or even a simple code:
> > >
> > >(html:td "foo")
> > >i got this error in my code:
> > >java -cp /usr/local/share/java/kawa-2.1.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl -C DBtoWebObserversKawa.scm
> > >(compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
> > >Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
> > >         at gnu.expr.LitTable.error(LitTable.java:103)
> > >         at gnu.expr.LitTable.writeObject(LitTable.java:271)
> >
> > I'm not seeing this.
> >
> > Kawa-2.1 is awfully old - however the old kawa-2.1.jar does work for me.
> >
> > Perhaps you could post a complete self-contained program?
> > --
> > --Per Bothner
> > [hidden email]   http://per.bothner.com/


Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
I checked in a fix, in both the master and kawa-2.4 branches.

The bug only happened when the value of (html:td result) is not used.
You might say: But it is used in:
                        (set! html-literal-table-data-code
                              (html:td result))

No, because html-literal-table-data-code is not used, so the assignment
is ignored (except for possible side-effects).
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
hello,

i just want to genrate something like this:

<TD align=center>

but seems not available in kawa, see the errors:
./kawa --output-format html
#|kawa:2|# #<td align=center>toto</td>
/dev/stdin:2:13: missing attribute value
/dev/stdin:2:14: missing space before attribute
/dev/stdin:2:19: missing '=' after attribute
/dev/stdin:2:20: missing attribute value
/dev/stdin:2:21: missing space before attribute
/dev/stdin:2:24: missing '=' after attribute
/dev/stdin:2:25: missing attribute value
/dev/stdin:2:26: missing space before attribute
/dev/stdin:2:28: missing '=' after attribute
/dev/stdin:3:1: missing attribute value
/dev/stdin:3:1: missing '>' after start element

i also try first variants like this:

#|kawa:3|# (html:td "toto")
<td>toto</td>

i can find a place to put the options of an html TAG
is there a way to do it? or not yet implemented?
i have tested this with kawa-2.4 and kawa-2.1

regards,
damien


Le Monday 15 May 2017 20:51:11 Per Bothner, vous avez écrit :
> I checked in a fix, in both the master and kawa-2.4 branches.
>
> The bug only happened when the value of (html:td result) is not used.
> You might say: But it is used in:
> (set! html-literal-table-data-code
>      (html:td result))
>
> No, because html-literal-table-data-code is not used, so the assignment
> is ignored (except for possible side-effects).


Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Sudarshan S Chawathe
> i also try first variants like this:
>
> #|kawa:3|# (html:td "toto")
> <td>toto</td>
>
> i can find a place to put the options of an html TAG
> is there a way to do it? or not yet implemented?

Something like the following works:

  (html:td class: "foo" "here is content")

Regards,

-chaw

Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
thank you,
it solves the problem
Damien

Le Monday 22 May 2017 12:14:02 Sudarshan S Chawathe, vous avez écrit :

> > i also try first variants like this:
> >
> > #|kawa:3|# (html:td "toto")
> > <td>toto</td>
> >
> > i can find a place to put the options of an html TAG
> > is there a way to do it? or not yet implemented?
>
> Something like the following works:
>
>   (html:td class: "foo" "here is content")
>
> Regards,
>
> -chaw
>
>


Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
any idea?

for creating  this with literals:

<TABLE DIR=LTR BORDER width="315" id="table_observateurs">

harder than it seems,due to BORDER and '"' :-(

?

damien

Le Monday 22 May 2017 15:44:42 Damien MATTEI, vous avez écrit :

> thank you,
> it solves the problem
> Damien
>
> Le Monday 22 May 2017 12:14:02 Sudarshan S Chawathe, vous avez écrit :
> > > i also try first variants like this:
> > >
> > > #|kawa:3|# (html:td "toto")
> > > <td>toto</td>
> > >
> > > i can find a place to put the options of an html TAG
> > > is there a way to do it? or not yet implemented?
> >
> > Something like the following works:
> >
> >   (html:td class: "foo" "here is content")
> >
> > Regards,
> >
> > -chaw
> >
> >
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
In reply to this post by Damien Mattei
On 05/22/2017 02:26 AM, Damien MATTEI wrote:

> hello,
>
> i just want to genrate something like this:
>
> <TD align=center>
>
> but seems not available in kawa, see the errors:
> ./kawa --output-format html
> #|kawa:2|# #<td align=center>toto</td>
> /dev/stdin:2:13: missing attribute value
> /dev/stdin:2:14: missing space before attribute
> /dev/stdin:2:19: missing '=' after attribute
> /dev/stdin:2:20: missing attribute value
> /dev/stdin:2:21: missing space before attribute
> /dev/stdin:2:24: missing '=' after attribute
> /dev/stdin:2:25: missing attribute value
> /dev/stdin:2:26: missing space before attribute
> /dev/stdin:2:28: missing '=' after attribute
> /dev/stdin:3:1: missing attribute value
> /dev/stdin:3:1: missing '>' after start element

The error messages could do with improvement. but the fix is simple:
Attributes values have to be quoted in XML and XML literals,
though not always in HTML:

#<td align="center">toto</td>

> any idea?
> for creating  this with literals:
<TABLE DIR=LTR BORDER width="315" id="table_observateurs">

With XML literals:
#<TABLE DIR="LTR" BORDER width="315" id="table_observateurs"></TABLE>

However, note that case is significant in XML (though not HTML), so I recommend lower-case:

#<table dir="LTR" border width="315" id="table_observateurs"></table>

Using function call syntax:

(html:table dir: "LTR" width: 315 id: "table_observateurs")

Number attribute values don't have to be quoted - it should work either way.
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Fwd: xml literals

Damien Mattei-2
---------- Forwarded message ----------
From: Damien Mattei <[hidden email]>
Date: Tue, May 23, 2017 at 1:08 PM
Subject: Re: xml literals
To: Per Bothner <[hidden email]>


thank you Per,
i cannot test all for now but it works,
just :

On Mon, May 22, 2017 at 5:44 PM, Per Bothner <[hidden email]> wrote:


> With XML literals:
> #<TABLE DIR="LTR" BORDER width="315" id="table_observateurs"></TABLE>
works with BORDER="1"  in Kawa  , HTML also accept BORDER alone .


>> /dev/stdin:3:1: missing '>' after start element
>
>
> The error messages could do with improvement. but the fix is simple:
> Attributes values have to be quoted in XML and XML literals,
> though not always in HTML:
>
> #<td align="center">toto</td>
>
>> any idea?
>> for creating  this with literals:
>
> <TABLE DIR=LTR BORDER width="315" id="table_observateurs">
>
>
> However, note that case is significant in XML (though not HTML), so I
> recommend lower-case:
>
> #<table dir="LTR" border width="315" id="table_observateurs"></table>
>
> Using function call syntax:
>
> (html:table dir: "LTR" width: 315 id: "table_observateurs")
>
> Number attribute values don't have to be quoted - it should work either way.
>
> --
>         --Per Bothner
> [hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
In reply to this post by Damien Mattei
On 05/22/2017 02:26 AM, Damien MATTEI wrote:

> hello,
>
> i just want to genrate something like this:
>
> <TD align=center>
>
> but seems not available in kawa, see the errors:
> ./kawa --output-format html
> #|kawa:2|# #<td align=center>toto</td>
> /dev/stdin:2:13: missing attribute value
> /dev/stdin:2:14: missing space before attribute
> /dev/stdin:2:19: missing '=' after attribute
> /dev/stdin:2:20: missing attribute value
> /dev/stdin:2:21: missing space before attribute
> /dev/stdin:2:24: missing '=' after attribute
> /dev/stdin:2:25: missing attribute value
> /dev/stdin:2:26: missing space before attribute
> /dev/stdin:2:28: missing '=' after attribute
> /dev/stdin:3:1: missing attribute value
> /dev/stdin:3:1: missing '>' after start element

I checked in (to the master branch) some better error recovery:

$ kawa
#|kawa:1|# #<td align=center>toto</td>
/dev/stdin:1:12: missing attribute value (literal values must be quoted)
#|kawa:2|#

--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
In reply to this post by Per Bothner

Le Monday 15 May 2017 20:51:11 Per Bothner, vous avez écrit :
> I checked in a fix, in both the master and kawa-2.4 branches.
>
> The bug only happened when the value of (html:td result) is not used.
> You might say: But it is used in:
> (set! html-literal-table-data-code
>      (html:td result))
>
> No, because html-literal-table-data-code is not used, so the assignment
> is ignored (except for possible side-effects).


hello Per,

it seems the bug is still active under some circumstances,
i have made a few modif. in the code and even if the literal is used i have the same error:

mattei@moita Jkawa]$  java -cp /home/mattei/kawa-2.4/lib/kawa.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl --output-format html -C DBtoWebObserversKawa.scm
(compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
        at gnu.expr.LitTable.error(LitTable.java:122)
        at gnu.expr.LitTable.writeObject(LitTable.java:282)
        at gnu.expr.LitTable.emit(LitTable.java:85)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2210)
        at gnu.expr.Compilation.process(Compilation.java:1943)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:306)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:288)
        at kawa.repl.compileFiles(repl.java:780)
        at kawa.repl.processArgs(repl.java:441)
        at kawa.repl.main(repl.java:820)

i have make some development in the code, and i cannot tell exactly what is the new instructions causing the same error again,
i compiled it with the latest stable kawa-2.4 binary, i suppose your fixs are in the binary too.

i have provided the source code in attachment, it should compile till it reach the error the same way on your host than on mine (i have commeted out some include scheme files from my library
 but there is no concern about that to compile)

youn can compile it with your 2.4 kawa version like this:
java -cp kawa-2.4.jar kawa.repl --output-format html -C DBtoWebObserversKawa.scm

i suppose the news instructions causing the trouble are in those part of my code:

in a let i assign option-lst to '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs")

and use it here:

;; HTML table with options
;; Kawa offers simple slicing: @ not in Scheme R7RS
     (set! html-literal-table
            (html:table @option-lst @literal-rows-list))
     
     ;; HTML
     (set! html-literal
           (html:td align: "center" html-literal-table))
     
     (set! html-literal-str (html-literal:toString))
     
     (display-msg-var-nl  "DBtoWebObserversKawa : work : html-literal-str = " html-literal-str)
     
     (display-msg-var-nl  "DBtoWebObserversKawa : work : res = " res)
     
     (append-string-to-result html-literal-str)

but i also add some change in the literals in the WHILE loop before,
is uppose if i revert all the changes it will compile again at some point...

i had made some test in REPL before coding and all was good exept one time the REPL exit to shell after an error,
i have made a lot of test here is a sample that lead to error in shell (i admit my literal input was strange...):
[mattei@moita bin]$ ./kawa --output-format html
#|kawa:1|# (html:td "foo")
<td>foo</td>
#|kawa:2|# (define td1 (html:td "foo"))
#|kawa:3|# (define td-lst (list td1 td1 td1))
#|kawa:4|# td-lst
<list><td>foo</td> <td>foo</td> <td>foo</td></list>
#|kawa:5|# (car td-lst)
<td>foo</td>
#|kawa:6|# (eval `(html:table ,td-lst))
java.lang.NullPointerException
        at gnu.xml.XMLPrinter.getHtmlTag(XMLPrinter.java:525)
        at gnu.xml.XMLPrinter.startElement(XMLPrinter.java:498)
        at gnu.lists.TreeList.consumeIRange(TreeList.java:1252)
        at gnu.lists.TreeList.consumeNext(TreeList.java:1080)
        at gnu.xml.XMLPrinter.writeObject(XMLPrinter.java:723)
        at gnu.kawa.xml.NodeConstructor.popNodeContext(NodeConstructor.java:67)
        at atEvalLevel-1.run(<eval>)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.lang.Eval.evalBody(Eval.java:100)
        at kawa.lang.Eval.evalForm$X(Eval.java:27)
        at kawa.lib.scheme.eval.eval$X(eval.scm:9)
        at kawa.lib.scheme.eval.eval$X(eval.scm)
        at atInteractiveLevel-6.run(stdin:6)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)
<{null name}
#|kawa:7|# `(html:table td-lst)
#|kawa:8|# `(html:table ,td-lst)
#|kawa:9|# (apply html:table td-lst)
#|kawa:10|# (define bar (apply html:table td-lst))
#|kawa:11|# bar
#|kawa:12|# (display bar)
<table xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></table>
#|kawa:13|# (define bar2 `(html:table ,td-lst))
#|kawa:14|# bar2
#|kawa:15|# (display bar2)
(html:table
 (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>))
#|kawa:16|# td-lst
#|kawa:17|# (display td-lst)
(<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
 <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
 <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
#|kawa:18|# DIR:
/dev/stdin:18:1: warning - keyword should be quoted if not in argument position
java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
        at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
        at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
        at atInteractiveLevel-18.run(stdin:18)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)
#|kawa:19|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
#|kawa:20|# option-lst
java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
        at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
        at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
        at gnu.mapping.Values.writeValues(Values.java:226)
        at atInteractiveLevel-20.run(stdin:20)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)
#|kawa:21|# td-lst
#|kawa:22|# (display td-lst
#|.....23|# )
(<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
 <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
 <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
#|kawa:24|# (append option-lst td-lst)
java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
        at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
        at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
        at gnu.mapping.Values.writeValues(Values.java:226)
        at atInteractiveLevel-24.run(stdin:24)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)
#|kawa:25|# (define option-lst '('DIR: "LTR" 'BORDER: 1 'width: 315 'id: "table_observateurs"))
#|kawa:26|# option-lst
java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
        at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
        at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
        at gnu.mapping.Values.writeValues(Values.java:226)
        at atInteractiveLevel-26.run(stdin:26)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)
#|kawa:27|# (list DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs")
java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
        at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
        at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
        at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
        at gnu.mapping.Values.writeValues(Values.java:226)
        at gnu.mapping.CallContext.writeValue(CallContext.java:333)
        at gnu.mapping.Procedure.apply(Procedure.java:153)
        at gnu.mapping.Procedure.apply(Procedure.java:118)
        at gnu.mapping.CallContext.runUntilDone(CallContext.java:227)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:349)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)
#|kawa:28|# (define tbl-rows (apply html:tr td-lst))
#|kawa:29|# tbl-rows
#|kawa:30|# (display tbl-rows)
<tr xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></tr>
#|kawa:31|# html:table
#|kawa:32|# list
#|kawa:33|# car
#|kawa:34|#
#|kawa:35|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
#|kawa:36|# `(html-table ,@option-lst ,@tbl-rows)
Exception in thread "main" java.lang.Error: expected list in quasi-quote splicing
        at kawa.lang.Quote.append$V(Quote.java:418)
        at atInteractiveLevel-36.run(stdin:36)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
        at kawa.Shell.run(Shell.java:283)
        at kawa.Shell.run(Shell.java:196)
        at kawa.Shell.run(Shell.java:183)
        at kawa.repl.processArgs(repl.java:714)
        at kawa.repl.main(repl.java:820)

shell exit here

another run that does not exit with error to shell:
[mattei@moita bin]$ ./kawa --output-format html
#|kawa:1|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
#|kawa:2|# (define td1 (html:td "foo"))
#|kawa:3|# (define td-lst (list td1 td1 td1))
#|kawa:4|# td-lst
<list><td>foo</td> <td>foo</td> <td>foo</td></list>
#|kawa:5|# (car td-lst)
<td>foo</td>
#|kawa:6|# (display td-lst)
(<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
 <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
 <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
#|kawa:7|# (define tbl-rows (apply html:tr td-lst))
#|kawa:8|# (display tbl-rows)
<tr xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></tr>
#|kawa:9|# (html:tr @td-lst)
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
#|kawa:10|# (map html:tr td-lst)
<list><tr><td>foo</td></tr> <tr><td>foo</td></tr> <tr><td>foo</td></tr></list>
#|kawa:11|# (define tbl-row-lst (map html:tr td-lst))
#|kawa:12|# tbl-row-lst
<list><tr><td>foo</td></tr> <tr><td>foo</td></tr> <tr><td>foo</td></tr></list>
#|kawa:13|# (html:table DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs" @tbl-row-lst)
<table DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td>foo</td></tr><tr><td>foo</td></tr><tr><td>foo</td></tr></table>
#|kawa:14|# (html:table @option-lst @tbl-row-lst)
<table DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td>foo</td></tr><tr><td>foo</td></tr><tr><td>foo</td></tr></table>
#|kawa:15|# (display option-lst)
(DIR: LTR BORDER: 1 width: 315 id: table_observateurs)
#|kawa:16|# `(html-table ,@option-lst ,@tbl-row-lst)
<list>html-table  DIR=" LTR " BORDER=" 1 " width=" 315 " id=" table_observateurs <tr<tdfoo></td></tr> <tr<tdfoo></td></tr> <tr<tdfoo></td></tr></list>
#|kawa:17|# (exit)
Vous avez du nouveau courrier dans /var/spool/mail/mattei
[mattei@moita bin]$ pwd
/home/mattei/kawa-2.4/bin


those examples are with kawa-2.4, the last one run well, but when i do similar thing in code i have the error

i also test if first with kawa-2.1 as i expected it to do not make error if the literal was used

regards,

damien

included file: DBtoWebObserversKawa.scm

DBtoWebObserversKawa.scm (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
i checked in my Dropbox history at what point did the code begin to compile with error and issued a diif on the files and get this:
[mattei@moita Jkawa]$ diff DBtoWebObserversKawa.scm DBtoWebObserversKawa_first_bug.scm
287c287
<          (html:td html-literal-table))
---
>          (html:td align: "center" html-literal-table))

seems that the simple fact to add an attribute makes the errors.

Le Tuesday 06 June 2017 11:26:16 Damien MATTEI, vous avez écrit :

>
> Le Monday 15 May 2017 20:51:11 Per Bothner, vous avez écrit :
> > I checked in a fix, in both the master and kawa-2.4 branches.
> >
> > The bug only happened when the value of (html:td result) is not used.
> > You might say: But it is used in:
> > (set! html-literal-table-data-code
> >      (html:td result))
> >
> > No, because html-literal-table-data-code is not used, so the assignment
> > is ignored (except for possible side-effects).
>
>
> hello Per,
>
> it seems the bug is still active under some circumstances,
> i have made a few modif. in the code and even if the literal is used i have the same error:
>
> mattei@moita Jkawa]$  java -cp /home/mattei/kawa-2.4/lib/kawa.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl --output-format html -C DBtoWebObserversKawa.scm
> (compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
> Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
>         at gnu.expr.LitTable.error(LitTable.java:122)
>         at gnu.expr.LitTable.writeObject(LitTable.java:282)
>         at gnu.expr.LitTable.emit(LitTable.java:85)
>         at gnu.expr.Compilation.generateBytecode(Compilation.java:2210)
>         at gnu.expr.Compilation.process(Compilation.java:1943)
>         at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:306)
>         at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:288)
>         at kawa.repl.compileFiles(repl.java:780)
>         at kawa.repl.processArgs(repl.java:441)
>         at kawa.repl.main(repl.java:820)
>
> i have make some development in the code, and i cannot tell exactly what is the new instructions causing the same error again,
> i compiled it with the latest stable kawa-2.4 binary, i suppose your fixs are in the binary too.
>
> i have provided the source code in attachment, it should compile till it reach the error the same way on your host than on mine (i have commeted out some include scheme files from my library
>  but there is no concern about that to compile)
>
> youn can compile it with your 2.4 kawa version like this:
> java -cp kawa-2.4.jar kawa.repl --output-format html -C DBtoWebObserversKawa.scm
>
> i suppose the news instructions causing the trouble are in those part of my code:
>
> in a let i assign option-lst to '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs")
>
> and use it here:
>
> ;; HTML table with options
> ;; Kawa offers simple slicing: @ not in Scheme R7RS
>      (set! html-literal-table
>    (html:table @option-lst @literal-rows-list))
>      
>      ;; HTML
>      (set! html-literal
>   (html:td align: "center" html-literal-table))
>      
>      (set! html-literal-str (html-literal:toString))
>      
>      (display-msg-var-nl  "DBtoWebObserversKawa : work : html-literal-str = " html-literal-str)
>      
>      (display-msg-var-nl  "DBtoWebObserversKawa : work : res = " res)
>      
>      (append-string-to-result html-literal-str)
>
> but i also add some change in the literals in the WHILE loop before,
> is uppose if i revert all the changes it will compile again at some point...
>
> i had made some test in REPL before coding and all was good exept one time the REPL exit to shell after an error,
> i have made a lot of test here is a sample that lead to error in shell (i admit my literal input was strange...):
> [mattei@moita bin]$ ./kawa --output-format html
> #|kawa:1|# (html:td "foo")
> <td>foo</td>
> #|kawa:2|# (define td1 (html:td "foo"))
> #|kawa:3|# (define td-lst (list td1 td1 td1))
> #|kawa:4|# td-lst
> <list><td>foo</td> <td>foo</td> <td>foo</td></list>
> #|kawa:5|# (car td-lst)
> <td>foo</td>
> #|kawa:6|# (eval `(html:table ,td-lst))
> java.lang.NullPointerException
>         at gnu.xml.XMLPrinter.getHtmlTag(XMLPrinter.java:525)
>         at gnu.xml.XMLPrinter.startElement(XMLPrinter.java:498)
>         at gnu.lists.TreeList.consumeIRange(TreeList.java:1252)
>         at gnu.lists.TreeList.consumeNext(TreeList.java:1080)
>         at gnu.xml.XMLPrinter.writeObject(XMLPrinter.java:723)
>         at gnu.kawa.xml.NodeConstructor.popNodeContext(NodeConstructor.java:67)
>         at atEvalLevel-1.run(<eval>)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.lang.Eval.evalBody(Eval.java:100)
>         at kawa.lang.Eval.evalForm$X(Eval.java:27)
>         at kawa.lib.scheme.eval.eval$X(eval.scm:9)
>         at kawa.lib.scheme.eval.eval$X(eval.scm)
>         at atInteractiveLevel-6.run(stdin:6)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
> <{null name}
> #|kawa:7|# `(html:table td-lst)
> #|kawa:8|# `(html:table ,td-lst)
> #|kawa:9|# (apply html:table td-lst)
> #|kawa:10|# (define bar (apply html:table td-lst))
> #|kawa:11|# bar
> #|kawa:12|# (display bar)
> <table xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></table>
> #|kawa:13|# (define bar2 `(html:table ,td-lst))
> #|kawa:14|# bar2
> #|kawa:15|# (display bar2)
> (html:table
>  (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>   <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>   <td xmlns="http://www.w3.org/1999/xhtml">foo</td>))
> #|kawa:16|# td-lst
> #|kawa:17|# (display td-lst)
> (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
> #|kawa:18|# DIR:
> /dev/stdin:18:1: warning - keyword should be quoted if not in argument position
> java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
>         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
>         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
>         at atInteractiveLevel-18.run(stdin:18)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
> #|kawa:19|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
> #|kawa:20|# option-lst
> java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
>         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
>         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
>         at gnu.mapping.Values.writeValues(Values.java:226)
>         at atInteractiveLevel-20.run(stdin:20)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
> #|kawa:21|# td-lst
> #|kawa:22|# (display td-lst
> #|.....23|# )
> (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
> #|kawa:24|# (append option-lst td-lst)
> java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
>         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
>         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
>         at gnu.mapping.Values.writeValues(Values.java:226)
>         at atInteractiveLevel-24.run(stdin:24)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
> #|kawa:25|# (define option-lst '('DIR: "LTR" 'BORDER: 1 'width: 315 'id: "table_observateurs"))
> #|kawa:26|# option-lst
> java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
>         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
>         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
>         at gnu.mapping.Values.writeValues(Values.java:226)
>         at atInteractiveLevel-26.run(stdin:26)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
> #|kawa:27|# (list DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs")
> java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
>         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
>         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
>         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
>         at gnu.mapping.Values.writeValues(Values.java:226)
>         at gnu.mapping.CallContext.writeValue(CallContext.java:333)
>         at gnu.mapping.Procedure.apply(Procedure.java:153)
>         at gnu.mapping.Procedure.apply(Procedure.java:118)
>         at gnu.mapping.CallContext.runUntilDone(CallContext.java:227)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:349)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
> #|kawa:28|# (define tbl-rows (apply html:tr td-lst))
> #|kawa:29|# tbl-rows
> #|kawa:30|# (display tbl-rows)
> <tr xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></tr>
> #|kawa:31|# html:table
> #|kawa:32|# list
> #|kawa:33|# car
> #|kawa:34|#
> #|kawa:35|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
> #|kawa:36|# `(html-table ,@option-lst ,@tbl-rows)
> Exception in thread "main" java.lang.Error: expected list in quasi-quote splicing
>         at kawa.lang.Quote.append$V(Quote.java:418)
>         at atInteractiveLevel-36.run(stdin:36)
>         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
>         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
>         at kawa.Shell.run(Shell.java:283)
>         at kawa.Shell.run(Shell.java:196)
>         at kawa.Shell.run(Shell.java:183)
>         at kawa.repl.processArgs(repl.java:714)
>         at kawa.repl.main(repl.java:820)
>
> shell exit here
>
> another run that does not exit with error to shell:
> [mattei@moita bin]$ ./kawa --output-format html
> #|kawa:1|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
> #|kawa:2|# (define td1 (html:td "foo"))
> #|kawa:3|# (define td-lst (list td1 td1 td1))
> #|kawa:4|# td-lst
> <list><td>foo</td> <td>foo</td> <td>foo</td></list>
> #|kawa:5|# (car td-lst)
> <td>foo</td>
> #|kawa:6|# (display td-lst)
> (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
>  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
> #|kawa:7|# (define tbl-rows (apply html:tr td-lst))
> #|kawa:8|# (display tbl-rows)
> <tr xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></tr>
> #|kawa:9|# (html:tr @td-lst)
> <tr><td>foo</td><td>foo</td><td>foo</td></tr>
> #|kawa:10|# (map html:tr td-lst)
> <list><tr><td>foo</td></tr> <tr><td>foo</td></tr> <tr><td>foo</td></tr></list>
> #|kawa:11|# (define tbl-row-lst (map html:tr td-lst))
> #|kawa:12|# tbl-row-lst
> <list><tr><td>foo</td></tr> <tr><td>foo</td></tr> <tr><td>foo</td></tr></list>
> #|kawa:13|# (html:table DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs" @tbl-row-lst)
> <table DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td>foo</td></tr><tr><td>foo</td></tr><tr><td>foo</td></tr></table>
> #|kawa:14|# (html:table @option-lst @tbl-row-lst)
> <table DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td>foo</td></tr><tr><td>foo</td></tr><tr><td>foo</td></tr></table>
> #|kawa:15|# (display option-lst)
> (DIR: LTR BORDER: 1 width: 315 id: table_observateurs)
> #|kawa:16|# `(html-table ,@option-lst ,@tbl-row-lst)
> <list>html-table  DIR=" LTR " BORDER=" 1 " width=" 315 " id=" table_observateurs <tr<tdfoo></td></tr> <tr<tdfoo></td></tr> <tr<tdfoo></td></tr></list>
> #|kawa:17|# (exit)
> Vous avez du nouveau courrier dans /var/spool/mail/mattei
> [mattei@moita bin]$ pwd
> /home/mattei/kawa-2.4/bin
>
>
> those examples are with kawa-2.4, the last one run well, but when i do similar thing in code i have the error
>
> i also test if first with kawa-2.1 as i expected it to do not make error if the literal was used
>
> regards,
>
> damien
>
> included file: DBtoWebObserversKawa.scm
>


Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
in fact only the function call syntax attributes cause the error:
(html:td align: "center" html-literal-table)

i will get this error:
[mattei@moita Jkawa]$ java -cp /home/mattei/kawa-2.4/lib/kawa.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl --output-format html -C DBtoWebObserversKawa.scm
(compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
        at gnu.expr.LitTable.error(LitTable.java:122)
        at gnu.expr.LitTable.writeObject(LitTable.java:282)
        at gnu.expr.LitTable.emit(LitTable.java:85)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2210)
        at gnu.expr.Compilation.process(Compilation.java:1943)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:306)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:288)
        at kawa.repl.compileFiles(repl.java:780)
        at kawa.repl.processArgs(repl.java:441)
        at kawa.repl.main(repl.java:820)

if i create the literal with # there is no error with the test ( i haven't checked in my program which use more complex literals):
#<TD align="center">html-literal-table</TD>

i have no errors:
[mattei@moita Jkawa]$ java -cp /home/mattei/kawa-2.4/lib/kawa.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl --output-format html -C DBtoWebObserversKawa.scm
(compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
/home/mattei/Dropbox/Jkawa/../git/LOGIKI/lib/set.scm:132:3: warning - no declaration seen for andmap

i will continue to debug my program with # literals...

Damien

Le Wednesday 07 June 2017 16:17:05 Damien MATTEI, vous avez écrit :

> i checked in my Dropbox history at what point did the code begin to compile with error and issued a diif on the files and get this:
> [mattei@moita Jkawa]$ diff DBtoWebObserversKawa.scm DBtoWebObserversKawa_first_bug.scm
> 287c287
> <          (html:td html-literal-table))
> ---
> >          (html:td align: "center" html-literal-table))
>
> seems that the simple fact to add an attribute makes the errors.
>
> Le Tuesday 06 June 2017 11:26:16 Damien MATTEI, vous avez écrit :
> >
> > Le Monday 15 May 2017 20:51:11 Per Bothner, vous avez écrit :
> > > I checked in a fix, in both the master and kawa-2.4 branches.
> > >
> > > The bug only happened when the value of (html:td result) is not used.
> > > You might say: But it is used in:
> > > (set! html-literal-table-data-code
> > >      (html:td result))
> > >
> > > No, because html-literal-table-data-code is not used, so the assignment
> > > is ignored (except for possible side-effects).
> >
> >
> > hello Per,
> >
> > it seems the bug is still active under some circumstances,
> > i have made a few modif. in the code and even if the literal is used i have the same error:
> >
> > mattei@moita Jkawa]$  java -cp /home/mattei/kawa-2.4/lib/kawa.jar:/home/mattei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl --output-format html -C DBtoWebObserversKawa.scm
> > (compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversKawa)
> > Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
> >         at gnu.expr.LitTable.error(LitTable.java:122)
> >         at gnu.expr.LitTable.writeObject(LitTable.java:282)
> >         at gnu.expr.LitTable.emit(LitTable.java:85)
> >         at gnu.expr.Compilation.generateBytecode(Compilation.java:2210)
> >         at gnu.expr.Compilation.process(Compilation.java:1943)
> >         at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:306)
> >         at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:288)
> >         at kawa.repl.compileFiles(repl.java:780)
> >         at kawa.repl.processArgs(repl.java:441)
> >         at kawa.repl.main(repl.java:820)
> >
> > i have make some development in the code, and i cannot tell exactly what is the new instructions causing the same error again,
> > i compiled it with the latest stable kawa-2.4 binary, i suppose your fixs are in the binary too.
> >
> > i have provided the source code in attachment, it should compile till it reach the error the same way on your host than on mine (i have commeted out some include scheme files from my library
> >  but there is no concern about that to compile)
> >
> > youn can compile it with your 2.4 kawa version like this:
> > java -cp kawa-2.4.jar kawa.repl --output-format html -C DBtoWebObserversKawa.scm
> >
> > i suppose the news instructions causing the trouble are in those part of my code:
> >
> > in a let i assign option-lst to '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs")
> >
> > and use it here:
> >
> > ;; HTML table with options
> > ;; Kawa offers simple slicing: @ not in Scheme R7RS
> >      (set! html-literal-table
> >    (html:table @option-lst @literal-rows-list))
> >      
> >      ;; HTML
> >      (set! html-literal
> >   (html:td align: "center" html-literal-table))
> >      
> >      (set! html-literal-str (html-literal:toString))
> >      
> >      (display-msg-var-nl  "DBtoWebObserversKawa : work : html-literal-str = " html-literal-str)
> >      
> >      (display-msg-var-nl  "DBtoWebObserversKawa : work : res = " res)
> >      
> >      (append-string-to-result html-literal-str)
> >
> > but i also add some change in the literals in the WHILE loop before,
> > is uppose if i revert all the changes it will compile again at some point...
> >
> > i had made some test in REPL before coding and all was good exept one time the REPL exit to shell after an error,
> > i have made a lot of test here is a sample that lead to error in shell (i admit my literal input was strange...):
> > [mattei@moita bin]$ ./kawa --output-format html
> > #|kawa:1|# (html:td "foo")
> > <td>foo</td>
> > #|kawa:2|# (define td1 (html:td "foo"))
> > #|kawa:3|# (define td-lst (list td1 td1 td1))
> > #|kawa:4|# td-lst
> > <list><td>foo</td> <td>foo</td> <td>foo</td></list>
> > #|kawa:5|# (car td-lst)
> > <td>foo</td>
> > #|kawa:6|# (eval `(html:table ,td-lst))
> > java.lang.NullPointerException
> >         at gnu.xml.XMLPrinter.getHtmlTag(XMLPrinter.java:525)
> >         at gnu.xml.XMLPrinter.startElement(XMLPrinter.java:498)
> >         at gnu.lists.TreeList.consumeIRange(TreeList.java:1252)
> >         at gnu.lists.TreeList.consumeNext(TreeList.java:1080)
> >         at gnu.xml.XMLPrinter.writeObject(XMLPrinter.java:723)
> >         at gnu.kawa.xml.NodeConstructor.popNodeContext(NodeConstructor.java:67)
> >         at atEvalLevel-1.run(<eval>)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.lang.Eval.evalBody(Eval.java:100)
> >         at kawa.lang.Eval.evalForm$X(Eval.java:27)
> >         at kawa.lib.scheme.eval.eval$X(eval.scm:9)
> >         at kawa.lib.scheme.eval.eval$X(eval.scm)
> >         at atInteractiveLevel-6.run(stdin:6)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> > <{null name}
> > #|kawa:7|# `(html:table td-lst)
> > #|kawa:8|# `(html:table ,td-lst)
> > #|kawa:9|# (apply html:table td-lst)
> > #|kawa:10|# (define bar (apply html:table td-lst))
> > #|kawa:11|# bar
> > #|kawa:12|# (display bar)
> > <table xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></table>
> > #|kawa:13|# (define bar2 `(html:table ,td-lst))
> > #|kawa:14|# bar2
> > #|kawa:15|# (display bar2)
> > (html:table
> >  (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >   <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >   <td xmlns="http://www.w3.org/1999/xhtml">foo</td>))
> > #|kawa:16|# td-lst
> > #|kawa:17|# (display td-lst)
> > (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
> > #|kawa:18|# DIR:
> > /dev/stdin:18:1: warning - keyword should be quoted if not in argument position
> > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
> >         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
> >         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
> >         at atInteractiveLevel-18.run(stdin:18)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> > #|kawa:19|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
> > #|kawa:20|# option-lst
> > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
> >         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
> >         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
> >         at gnu.mapping.Values.writeValues(Values.java:226)
> >         at atInteractiveLevel-20.run(stdin:20)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> > #|kawa:21|# td-lst
> > #|kawa:22|# (display td-lst
> > #|.....23|# )
> > (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
> > #|kawa:24|# (append option-lst td-lst)
> > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
> >         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
> >         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
> >         at gnu.mapping.Values.writeValues(Values.java:226)
> >         at atInteractiveLevel-24.run(stdin:24)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> > #|kawa:25|# (define option-lst '('DIR: "LTR" 'BORDER: 1 'width: 315 'id: "table_observateurs"))
> > #|kawa:26|# option-lst
> > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
> >         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
> >         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
> >         at gnu.mapping.Values.writeValues(Values.java:226)
> >         at atInteractiveLevel-26.run(stdin:26)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> > #|kawa:27|# (list DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs")
> > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content
> >         at gnu.xml.XMLFilter.error(XMLFilter.java:1474)
> >         at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700)
> >         at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695)
> >         at gnu.mapping.Values.writeValues(Values.java:226)
> >         at gnu.mapping.CallContext.writeValue(CallContext.java:333)
> >         at gnu.mapping.Procedure.apply(Procedure.java:153)
> >         at gnu.mapping.Procedure.apply(Procedure.java:118)
> >         at gnu.mapping.CallContext.runUntilDone(CallContext.java:227)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:349)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> > #|kawa:28|# (define tbl-rows (apply html:tr td-lst))
> > #|kawa:29|# tbl-rows
> > #|kawa:30|# (display tbl-rows)
> > <tr xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></tr>
> > #|kawa:31|# html:table
> > #|kawa:32|# list
> > #|kawa:33|# car
> > #|kawa:34|#
> > #|kawa:35|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
> > #|kawa:36|# `(html-table ,@option-lst ,@tbl-rows)
> > Exception in thread "main" java.lang.Error: expected list in quasi-quote splicing
> >         at kawa.lang.Quote.append$V(Quote.java:418)
> >         at atInteractiveLevel-36.run(stdin:36)
> >         at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292)
> >         at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
> >         at kawa.Shell.run(Shell.java:283)
> >         at kawa.Shell.run(Shell.java:196)
> >         at kawa.Shell.run(Shell.java:183)
> >         at kawa.repl.processArgs(repl.java:714)
> >         at kawa.repl.main(repl.java:820)
> >
> > shell exit here
> >
> > another run that does not exit with error to shell:
> > [mattei@moita bin]$ ./kawa --output-format html
> > #|kawa:1|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs"))
> > #|kawa:2|# (define td1 (html:td "foo"))
> > #|kawa:3|# (define td-lst (list td1 td1 td1))
> > #|kawa:4|# td-lst
> > <list><td>foo</td> <td>foo</td> <td>foo</td></list>
> > #|kawa:5|# (car td-lst)
> > <td>foo</td>
> > #|kawa:6|# (display td-lst)
> > (<td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>
> >  <td xmlns="http://www.w3.org/1999/xhtml">foo</td>)
> > #|kawa:7|# (define tbl-rows (apply html:tr td-lst))
> > #|kawa:8|# (display tbl-rows)
> > <tr xmlns="http://www.w3.org/1999/xhtml"><td>foo</td><td>foo</td><td>foo</td></tr>
> > #|kawa:9|# (html:tr @td-lst)
> > <tr><td>foo</td><td>foo</td><td>foo</td></tr>
> > #|kawa:10|# (map html:tr td-lst)
> > <list><tr><td>foo</td></tr> <tr><td>foo</td></tr> <tr><td>foo</td></tr></list>
> > #|kawa:11|# (define tbl-row-lst (map html:tr td-lst))
> > #|kawa:12|# tbl-row-lst
> > <list><tr><td>foo</td></tr> <tr><td>foo</td></tr> <tr><td>foo</td></tr></list>
> > #|kawa:13|# (html:table DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs" @tbl-row-lst)
> > <table DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td>foo</td></tr><tr><td>foo</td></tr><tr><td>foo</td></tr></table>
> > #|kawa:14|# (html:table @option-lst @tbl-row-lst)
> > <table DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td>foo</td></tr><tr><td>foo</td></tr><tr><td>foo</td></tr></table>
> > #|kawa:15|# (display option-lst)
> > (DIR: LTR BORDER: 1 width: 315 id: table_observateurs)
> > #|kawa:16|# `(html-table ,@option-lst ,@tbl-row-lst)
> > <list>html-table  DIR=" LTR " BORDER=" 1 " width=" 315 " id=" table_observateurs <tr<tdfoo></td></tr> <tr<tdfoo></td></tr> <tr<tdfoo></td></tr></list>
> > #|kawa:17|# (exit)
> > Vous avez du nouveau courrier dans /var/spool/mail/mattei
> > [mattei@moita bin]$ pwd
> > /home/mattei/kawa-2.4/bin
> >
> >
> > those examples are with kawa-2.4, the last one run well, but when i do similar thing in code i have the error
> >
> > i also test if first with kawa-2.1 as i expected it to do not make error if the literal was used
> >
> > regards,
> >
> > damien
> >
> > included file: DBtoWebObserversKawa.scm
> >
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
In reply to this post by Damien Mattei
On 06/07/2017 07:17 AM, Damien MATTEI wrote:
> i checked in my Dropbox history at what point did the code begin to compile with error and issued a diif on the files and get this:
> [mattei@moita Jkawa]$ diff DBtoWebObserversKawa.scm DBtoWebObserversKawa_first_bug.scm
> 287c287
> <          (html:td html-literal-table))
> ---
>>           (html:td align: "center" html-literal-table))
>
> seems that the simple fact to add an attribute makes the errors.

Indeed, I've reproduced the problem.

I have to think about the best fix.
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
On 06/07/2017 09:23 AM, Per Bothner wrote:

> On 06/07/2017 07:17 AM, Damien MATTEI wrote:
>> i checked in my Dropbox history at what point did the code begin to compile with error and issued a diif on the files and get this:
>> [mattei@moita Jkawa]$ diff DBtoWebObserversKawa.scm DBtoWebObserversKawa_first_bug.scm
>> 287c287
>> <          (html:td html-literal-table))
>> ---
>>>           (html:td align: "center" html-literal-table))
>>
>> seems that the simple fact to add an attribute makes the errors.
>
> Indeed, I've reproduced the problem.
>
> I have to think about the best fix.

Using XML literals works:

  #<td align="center">&[html-literal-table]</>
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Damien Mattei
works... yes but , i have find some interesting clues:

-still needing to use the literal to avoid the error:
Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does not implement Externalizable
if you issue a literal:toString it avoids the compiler trying to "Externalize" an object it does know how to externs but know how to do it for it for String

example:
(set! html-literal
        #<td align="center">&[html-literal-table]</>)
     
     (set! html-literal-str (html-literal:toString))

no compile error

the problem is not specific to function call style but also with # literal, but after all perheaps it is the side effect of set! returning a literal which should be avoid in the code... i do not know.

-(simple ) slicing, a Kawa only feature seems to do not work always in literals, here his some test examples:

 ;;(apply html:table literal-rows-list)) ;; OK
           ;;(html:table literal-rows-list)) ;; OK but non-sense
           ;;(html:table @literal-rows-list)) ;; KO
           ;;(html:table option-lst literal-rows-list)) ;; OK but non-sense
           ;;(html:table @option-lst @literal-rows-list)) ;; KO
           ;;#<table DIR="LTR" BORDER="1" width="312" id="table_observateurs">&[@literal-rows-list]</>) ;; KO
           ;;#<table DIR="LTR" BORDER="1" width="312" id="table_observateurs">@&[literal-rows-list]</>) ;; OK
           ;;#<table DIR="LTR" BORDER="1" width="312" id="table_observateurs">POPUP</>) ;; OK
           ;;#<table>POP UP</>) ;; OK
           ;;(html:table "POP UP")) ;; OK

for example this works:

(set! options-and-arguments-lst
           (append option-lst literal-rows-list))

        (set! html-literal-table
           (apply html:table options-and-arguments-lst)) ;; OK

but not those:
;;(html:table @literal-rows-list)) ;; KO
           ;;(html:table option-lst literal-rows-list)) ;; OK but non-sense
           ;;(html:table @option-lst @literal-rows-list)) ;; KO

the good thing is i finally succeed in making my program (in attachments) compiling and running by melting function call style and literal list but the both are working
 if you take some special cautions with side-effects and slicing too.

the output is not human readable:
<td align="center"><table xmlns="http://www.w3.org/1999/xhtml" DIR="LTR" BORDER="1" width="315" id="table_observateurs"><tr><td DIR="LTR" ALIGN="LEFT">RGY</td><td DIR="LTR" ALIGN="LEFT">NuLL</td></tr><tr><td DIR="LTR" ALIGN="LEFT">LM</td><td DIR="LTR" ALIGN="LEFT">NuLL</td></tr><tr><td DIR="LTR" ALIGN="LEFT">BSL</td><td DIR="LTR" ALIGN="LEFT">NuLL</td></tr><tr><td DIR="LTR" ALIGN="LEFT">KHA</td><td DIR="LTR" ALIGN="LEFT">  ? ? </td></tr><tr><td DIR="LTR" ALIGN="LEFT">TME</td><td DIR="LTR" ALIGN="LEFT">  ? ? </td></tr><tr><td DIR="LTR" ALIGN="LEFT">TM</td><td DIR="LTR" ALIGN="LEFT">?</td></tr><tr><td DIR="LTR" ALIGN="LEFT">ABT</td><td DIR="LTR" ALIGN="LEFT">Abetti G.</td></tr><tr><td DIR="LTR" ALIGN="LEFT">AFR</td><td DIR="LTR" ALIGN="LEFT">Africano</td></tr><tr><td DIR="LTR" ALIGN="LEFT">AHN</td><td DIR="LTR" ALIGN="LEFT">Ahnert P. von</td></tr>.......

i think there is a way to include in Kawa literal some non interpreted character,i see in the doc, to have some  human readable html page,i will try this later.

regards,

Damien

Le Wednesday 07 June 2017 20:16:05 Per Bothner, vous avez écrit :

> On 06/07/2017 09:23 AM, Per Bothner wrote:
> > On 06/07/2017 07:17 AM, Damien MATTEI wrote:
> >> i checked in my Dropbox history at what point did the code begin to compile with error and issued a diif on the files and get this:
> >> [mattei@moita Jkawa]$ diff DBtoWebObserversKawa.scm DBtoWebObserversKawa_first_bug.scm
> >> 287c287
> >> <          (html:td html-literal-table))
> >> ---
> >>>           (html:td align: "center" html-literal-table))
> >>
> >> seems that the simple fact to add an attribute makes the errors.
> >
> > Indeed, I've reproduced the problem.
> >
> > I have to think about the best fix.
>
> Using XML literals works:
>
>   #<td align="center">&[html-literal-table]</>


DBtoWebObserversKawa.scm (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
On 06/09/2017 08:13 AM, Damien MATTEI wrote:
> works... yes but , i have find some interesting clues:

I know exactly what the problem is.  I just need to decide among various
solutions, either:
(1) Make the MakeElement class Externalizable.
(2) Fix it so MakeElement with attributes gets optimized.

Neither are particularly difficult, but need a little bit of thought and effort.
Ideally, I should do both.

--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: xml literals

Per Bothner
On 06/09/2017 11:17 AM, Per Bothner wrote:

> On 06/09/2017 08:13 AM, Damien MATTEI wrote:
>> works... yes but , i have find some interesting clues:
>
> I know exactly what the problem is.  I just need to decide among various
> solutions, either:
> (1) Make the MakeElement class Externalizable.
> (2) Fix it so MakeElement with attributes gets optimized.
>
> Neither are particularly difficult, but need a little bit of thought and effort.
> Ideally, I should do both.

I checked in a fix - approach (1).

--
        --Per Bothner
[hidden email]   http://per.bothner.com/
12