On Tue, Apr 7, 2009 at 4:19 PM, Grant Rettke <span dir="ltr">&lt;<a href="mailto:grettke@acm.org">grettke@acm.org</a>&gt;</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&lt;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&#39;ve been using the xml module and scheme/match (see: [3] as an example) and there&#39;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 &#39;title _ title)<br>                     (list &#39;link<br>                           (list-no-order<br>
                            (list &#39;href url)<br>                            (list &#39;rel (regexp #rx&quot;^http://.*#cellsfeed$&quot;))<br>                            _ ...))<br>                     (list &#39;gs:rowCount _ row-count)<br>
                     (list &#39;gs:colCount _ col-count)<br>                     _ ...)<br>      (make-worksheet title url (s-&gt;n row-count) (s-&gt;n col-count))]<br>     [_ #f])<br>   (url-&gt;xexpr spreadsheet-url))</pre>
<br>wasn&#39;t so ugly.<br><br>I keep thinking the solution is to put a nice macro around scheme/match that is more xml&#39;ish - but I&#39;ll be darned if I can come up with: (a) the macro and (b) what&#39;s xml&#39;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>