chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Lowdown & sxml-serializer not working together


From: Moritz Heidkamp
Subject: Re: [Chicken-users] Lowdown & sxml-serializer not working together
Date: Thu, 22 Aug 2013 23:01:44 +0200

Hi Matt,

Matt Gushee <address@hidden> writes:
> markdown->sxml converts whitespace in the input to character objects,
> or lists of character objects, e.g.:
>
>    '(#\space)
>    #\newline
>
> ... but serialize-sxml can't handle these: evidently it wants either
> strings or symbols. I haven't found any arguments or parameters in
> either egg that seem to be able to affect this behavior.

yeah, Lowdown is cheating a bit here. Those individual characters fall
right out of the parser and it would require an additional walk of the
result to turn them into strings. As you already found out, this is not
really part of the SXML spec but most tools allow characters just fine
(sxml-serializer is an exception here and is particularly strict). Same
applies to the additional list wrapping. I usually serialize SXML like
this:

  (use sxml-transforms)
  (define some-data '(some #\d (#\a "ta")))
  (SRV:send-reply (pre-post-order some-data) universal-conversion-rules))

Which outputs:

  <some>data</some>

As you can see, universal-conversion-rules and SRV:send-reply (what's
the deal with that name?) don't care much about the structure. Note that
characters will not be entity escaped though, they are just passed
through as-is.

However, I do take your point and I think if I advertise Lowdown as
producing SXML I should better change it to produce SXML according to
spec :-) I hope I will get around to changing this soon but can't
promise when. I also hope the workaround above will serve you until
then!

Moritz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]