chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Another lowdown->sxml-serializer problem


From: Matt Gushee
Subject: Re: [Chicken-users] Another lowdown->sxml-serializer problem
Date: Fri, 11 Oct 2013 11:40:50 -0600

Hi, John etc.--

On Fri, Oct 11, 2013 at 7:58 AM, John Cowan <address@hidden> wrote:

>> 2. Convert w/ markdown->sxml:
>>
>> ((p "This" (#\space) "fragment" ....
>>  (a (@ (href ("http://call-cc.org/";))) "Chicken" (#\space) "Scheme") "."))
>
> Well, evidently this is a bug in markdown->sxml, since the above is not
> well-formed SXML.  Not only is the URL incorrectly being wrapped in a
> list, but the lists of characters aren't really SXML either.

Hmm, pretty much what I thought, but I'm not confident enough in my
understanding of SXML to have said that.

Well, any recommendations, then? This is holding up the release of a
new egg, so if Moritz doesn't have a quick fix for lowdown, I'd like
to try another approach. Despite what I said about sxml-transforms,
I'm willing to try it, but might need some help figuring it out.

The problem I've had when I've tried it is that namespace declarations
and processing instructions are not rendered properly--they are
escaped so as to become visible on an HTML page.

Actually, there aren't really any processing instructions--I am
referring to the XML declaration, which is syntactically equivalent to
a PI but is not really a PI; and since the XML declaration is not
strictly required, and I don't think PIs are widely used in general,
it wouldn't be a big deal to say "this system can't handle PIs or XML
declarations."

Namespaces, on the other hand, are an essential part of the process.
The template processor, civet, uses them to distinguish between
literal content and control structures, so the input XML template has
to have at least two namespace declarations, and it doesn't seem like
a good idea to omit them from the output (e.g. if the output is XHTML,
as I expect will usually be the case ... well, I need to research
this, but I highly suspect there are browsers that won't handle XHTML
correctly without the namespace declaration).

So, it probably isn't a very hard problem, but I just have not yet
grasped how to create custom rules for sxml-transforms. Any light you
can shed would be appreciated.

--
Matt Gushee



reply via email to

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