[plt-scheme] comments in xexpr - how to preserve?

From: Benjamin Simon (ben at amazingmedia.com)
Date: Wed Aug 6 10:15:36 EDT 2003

Howdy,

I'm currently trying to combine HtmlPrag [1] with PLT Scheme servlets.
This means that I need to convert the sxml output of HtmlPrag to an
xexpr format that will produce meaningful output for the Scheme servlet.

I've been working an sxml->xexpr function, and for the most part it
hasn't been bad to write.

However, as far as I can tell, xexpr ignores XML comments, while sxml
allows you to represent them as (*comment* ...). Usually it wouldn't be
a big deal to strip out comments, however, I'm parsing HTML that follows
the practice of doing:

   <script ...>
     <!-- 
       ...javascript code...
     // -->
   </script>

So, if I strip out comments, as xexpr seems to require, I lose all the
javascript on the page.  Ugh.

Any suggestions on how to deal with this? Is there any thoughts about
how xexpr may support comments?

I guess a broader question may be, how can I take advantage of tools
that deal with sxml, while inside of PLT scheme, which prefers to work
with xexpr.  Any tips for this?

Thanks,
Ben

[1] http://www.neilvandyke.org/htmlprag/

-- 
Ben Simon                                     Amazing Media, Inc.
(703) 234-5342 (work)                       (703) 937-7779 (cell)


Posted on the users mailing list.