[plt-scheme] xexprs and sxml

From: Dave Herman (dherman at ccs.neu.edu)
Date: Mon Jan 9 13:12:54 EST 2006

> Given the deeply complex nature of the XML <-> scheme-data  
> transformation, I think a direct transformation between xexprs and  SXML 
> would be vastly preferable.  Furthermore, I think it's pretty  much 
> trivial.  The only thing to worry about is tools that accept  xexprs and 

You'd hope, but I hit a snag last night. Entities (e.g., &nbsp; in HTML) 
are pre-expanded by a parser according to the DTD, so you don't end up 
with any entities in SXML that's parsing from XML. But if someone writes 
an x-expression with an entity in it:

     (html (body (p "foo" nbsp "bar")))

then you have to know what to generate from the entity. If you have a 
DTD, you have to parse it and interpret it. If you don't, you have to 
guess. Either way, non-trivial.

> assume the presence of the modifier-thingy list.  For this  reason, I 
> think I would design the SXML->xexpr translation to always  include the 
> modifier-thingy list, even if empty.

I have no idea what you're talking about.

> Then, you can staple those onto the web server with things like 'send- 
> suspend/sxml', and spend more time on research.  No?

Anton's suggestion was just to go SXML -> XML and pass the strings to 
the web-server, essentially bypassing any of the web-server's use of 
x-expressions at all. Lower-tech, but something that works now without 
me having to generate a mapping.

> P.S.: do you have any way (other than WebIt) to transform SXML into  
> XML?  Because I've looked, and couldn't find anything.

WebIt! is the best one I know. There's also TonyG's planet package:

     http://planet.plt-scheme.org/#xxexpr.plt1.0

but that appears to be imprecise.

Dave


Posted on the users mailing list.