I have become ever more attracted to JsonML &lt;<a href="http://jsonml.org/">http://jsonml.org/</a>&gt; as a way to handle XML data. Since E&#39;s term trees already handle JSON, I suggest using the JsonML mapping of XML data into JSON structures. I suggest we would then have no need for an XML quasi-parser. We could just use the term tree quasiparser in quasi-JsonML format, to manipulate XML trees as translated to JsonML structures. Even for text markup, which is the best case for the XML vs JsonML comparison, I still find JsonML notation more readable than XML.<br>
<br><br><br><div class="gmail_quote">On Tue, Jan 12, 2010 at 2:06 PM, Kevin Reid <span dir="ltr">&lt;<a href="mailto:kpreid@mac.com">kpreid@mac.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Oct 26, 2009, at 13:08, Thomas Leonard wrote:<br>
<br>
&gt; Could someone give some simple examples showing how to read and write<br>
&gt; XML using E?<br>
&gt;<br>
&gt; The XMLQuasiParser looks reasonable, but says it is deprecated in<br>
&gt; favour<br>
&gt; of using Terms. I can build Terms manually, but I can&#39;t see how to<br>
&gt; turn<br>
&gt; serialised XML into a Term, or a Term into serialised XML.<br>
&gt;<br>
&gt; I found this, but it doesn&#39;t say which methods to call:<br>
&gt;<br>
&gt; <a href="http://www.erights.org/data/terml/embeddings.html" target="_blank">http://www.erights.org/data/terml/embeddings.html</a><br>
&gt;<br>
&gt; There&#39;s also Term.updoc in the source, which shows how to convert a<br>
&gt; sml<br>
&gt; DOM to a term, but not the other way around. Also, sml doesn&#39;t support<br>
&gt; all of XML, e.g.<br>
&gt;<br>
&gt; ? sml`&lt;foo/&gt;`<br>
&gt; # problem: Failed: syntax error: expected &#39;&gt;&#39; but got &#39;/&#39; at 4<br>
<br>
</div>There is no E-styled XML library built into E; this is certainly<br>
something which ought to be addressed.<br>
<br>
Such a library should of course use immutable trees (vs. e.g. DOM<br>
which is mutable) and have quasiliteral/pattern support for users.<br>
<br>
<br>
E-on-JavaScript&#39;s Updoc-to-HTML component is an example of XML<br>
manipulation in E: it uses the Java DOM libraries (and, when a real E<br>
XML library exists, should be converted to use it).<br>
   <a href="http://wiki.erights.org/wiki/E-on-JavaScript" target="_blank">http://wiki.erights.org/wiki/E-on-JavaScript</a><br>
<br>
<br>
There are two different approaches which could be used for an E XML<br>
library: one is to use the Term-tree objects, and merely write an<br>
xml__quasiParser which allows one to use the XML-in-TermL embedding,<br>
as well as facilities for reading/writing XML documents. The other is<br>
to have a distinct object type for XML tree nodes; this has the<br>
advantage that its methods can be optimized for the needs of XML<br>
applications, and its __printOn would show XML rather than TermL.<br>
<br>
Parsing and printing could be handled for starters by using Java&#39;s<br>
builtin XML facilities; I&#39;m not sure exactly how much could be reused<br>
vs. reimplented.<br>
<br>
Questions:<br>
<br>
   * Would you be interested in working on the project of an XML library<br>
     for E?<br>
<br>
   * If I were to work on it, would you use it and give feedback?<br>
<font color="#888888"><br>
--<br>
Kevin Reid                                  &lt;<a href="http://switchb.org/kpreid/" target="_blank">http://switchb.org/kpreid/</a>&gt;<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
_______________________________________________<br>
e-lang mailing list<br>
<a href="mailto:e-lang@mail.eros-os.org">e-lang@mail.eros-os.org</a><br>
<a href="http://www.eros-os.org/mailman/listinfo/e-lang" target="_blank">http://www.eros-os.org/mailman/listinfo/e-lang</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Text by me above is hereby placed in the public domain<br><br>    Cheers,<br>    --MarkM<br><br>