[plt-scheme] SXML vs. X-expressions
Structurally, they're a pretty different.
<span class="foo"><a href="http://plt-scheme.org">PLT</a> is wonderful</span>
becomes
(*TOP*
(span
(@ (class "foo"))
(a (@ (href "http://plt-scheme.org")) "PLT")
" is wonderful"))
while xml->xexpr yields
(span
((class "foo"))
(a ((href "http://plt-scheme.org")) "PLT")
" is wonderful")
There's differences in how things like comments and PIs are handled as
well. SSAX has a number of libraries for doing things like XPath
processing, and is implemented on a number of Schemes. SSAX has a
highly customizable parser, and there are tools like HtmlPrag for
trying to make sense of badly formed XML. I tend to use SSAX, but the
xml collection is a bit simpler and I've used it for things where I
didn't need XPath and didn't want to mess with SSAX.
BTW, I was pleasantly surprised that SSAX is now part of the PLT
distro. Thank you, thank you, thank you!
On Fri, 22 Oct 2004 13:30:25 -0400, Doug Orleans <dougo at place.org> wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Forgive me if this is a FAQ, but what exactly is the relationship
> between SXML and PLT's X-expressions? Are they two competing ways of
> doing the same thing, or are there reasons to use both? I've been
> doing XML programming with just (lib "xml.ss" "xml"), but I'm
> wondering if I should switch to SXML/SSAX.
>
> --dougo at place.org
>