On Tue, Apr 7, 2009 at 4:19 PM, Grant Rettke <span dir="ltr"><<a href="mailto:grettke@acm.org">grettke@acm.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What is your favorite library for parsing XML in PLT 4?<br>
If nothing is available, then what do you use for PLT<4, R5 or R6 Scheme?<br></blockquote></div><br>Back when I was using SISC [1], I nearly always turned to ssax and sxpath. This especially made sense because SISCweb [2] worked natively with SXML.<br>
<br>But recently, I've been using the xml module and scheme/match (see: [3] as an example) and there's something about the solution I like. Whole match-the-shape of the xml expression / destructure on the fly is really cool.<br>
<br>I really wish scheme/match was less verbose so that code like [4]:<br><br><pre> (filter-map<br> (match-lambda<br> [(list-no-order (list 'title _ title)<br> (list 'link<br> (list-no-order<br>
(list 'href url)<br> (list 'rel (regexp #rx"^http://.*#cellsfeed$"))<br> _ ...))<br> (list 'gs:rowCount _ row-count)<br>
(list 'gs:colCount _ col-count)<br> _ ...)<br> (make-worksheet title url (s->n row-count) (s->n col-count))]<br> [_ #f])<br> (url->xexpr spreadsheet-url))</pre>
<br>wasn't so ugly.<br><br>I keep thinking the solution is to put a nice macro around scheme/match that is more xml'ish - but I'll be darned if I can come up with: (a) the macro and (b) what's xml'ish would actually look like :-).<br>
<br>-Ben<br clear="all"><br>[1] - <a href="http://sisc-scheme.org/">http://sisc-scheme.org/</a><br>[2] - <a href="http://siscweb.sourceforge.net">http://siscweb.sourceforge.net</a><br>[3] - <a href="http://benjisimon.blogspot.com/2009/04/another-plt-scheme-google-spreadsheets.html">http://benjisimon.blogspot.com/2009/04/another-plt-scheme-google-spreadsheets.html</a><br>
[4] - <a href="http://code.ideas2executables.com/scheme-gdata/spreadsheets.ss">http://code.ideas2executables.com/scheme-gdata/spreadsheets.ss</a><br><br><br>-- <br>Have an idea for software? I can make it happen - <a href="http://www.ideas2executables.com">http://www.ideas2executables.com</a><br>
My Blog: <a href="http://benjisimon.blogspot.com">http://benjisimon.blogspot.com</a><br>