<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">

I'm new to Ur/Web and I'm very impressed by the whole conception of the language and the framework.  I would like to develop a small test program to better get the feeling of the system.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I have a tree-like datatype as follows</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">

<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><div class="gmail_default">datatype tree =</div><div class="gmail_default">  | Leaf of { Label : string }</div><div class="gmail_default">

  | Node of { Label : string, Children : list tree}</div><div><br></div><div>and I would like to write values of tree type inside an SQL database.</div><div><br></div><div>Of course I can encode the tree structure in a corresponding Parent-Children table (as it is done in the "Tree" demo from the web site), but this is not what I would like to do, since i tend to consider these tree object as "atomic" values that are saved retrieved and queried all at once.</div>
<div><br></div><div>Of course it is easy to write a serialisation function</div><div>
  encodeString : tree -> string<br></div><div>or<br></div><div>  encodeXml : tree -> xbody<br></div><div>which already did and this allows in a simple way to save trees in the db.<br></div><div><br></div><div>The problem is reading back the values from the database (i.e., from the string or the xml encoding), i.e. write functions</div>
<div>  decodeString : string -> option tree</div>
<div>Does Ur has tools that can easy this task?</div><div>If I understand correctly, xml support is builtin in the sml implementation and no primitive for reading xml and/or analysing (pattern matching etc) are developed so far.</div>
<div><br></div><div>Are there other option than manually write a parser?</div><div><br></div><div>Thanks,</div><div>Marco </div></div></div>