[racket] xslt

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sat Feb 28 19:45:42 EST 2015

Matthew Butterick wrote on 02/28/2015 06:49 PM:
>  If the latter, then you may find that using native Racket data 
> structures (esp. the X-expression) and native XML-friendly functions 
> (like `match`) is more convenient.

Either SXML or X-expressions are OK for most purposes.

But, IMHO, SXML is somewhat better than Racket X-expressions for most 
purposes.

I tried X-expressions a few years ago, to try it while rapidly coding a 
research Web app, and it was OK for that purposes.  But before and since 
then, I've ended up preferring SXML for various XML and HTML work.

I think the hurdles to SXML use in Racket are:
* the libraries are not always neatly packaged, nor documented as 
libraries; and
* X-expressions are in official Racket, perhaps because they were 
already used for the old DrScheme documentation browser(?) before SXML 
caught on with everyone else, so people looking now assume that 
X-expressions are the way to go.

FWIW, I put some specification and coding work into trying to unify SXML 
and Racket X-expressions.  In the end, I decided that SXML's decisions 
on things like splicing -- which I originally thought were messy, and 
unnecessarily hard to implement in general-purposes SXML libraries -- 
turned out to be better design decisions for practical use.  For 
example, regarding splicing for efficient (immutable) manipulation, 
after I implemented a splicing construct in the unified language, I 
decided that Oleg's original approach was more elegant in practice.  So 
I threw out that unified stuff, and ended up with just a few small 
tweaks to SXML.

Neil V.


Posted on the users mailing list.