--- orig/srv/xml.cd.nw +++ mod/srv/xml.cd.nw @@ -79,32 +79,32 @@ type Ocaml_int = -1073741824 -- 1073741823 ;; type Ocaml_string = Latin1 ;; type Ocaml_kind = `Individual | `Delegate ;; -type Ocaml_participant = {| kind = Ocaml_kind; +type Ocaml_participant = { kind = Ocaml_kind; login = Ocaml_string; password = Ocaml_string; - groups = [ Ocaml_string* ] |} ;; -type Ocaml_response = {| r_desc = Ocaml_string; + groups = [ Ocaml_string* ] } ;; +type Ocaml_response = { r_desc = Ocaml_string; r_author = Ocaml_string; - r_links = [ Ocaml_string* ] |} ;; -type Ocaml_vote = {| voter = Ocaml_string; - choices = [ Ocaml_int* ] |} ;; + r_links = [ Ocaml_string* ] } ;; +type Ocaml_vote = { voter = Ocaml_string; + choices = [ Ocaml_int* ] } ;; type Ocaml_elected = Ocaml_int ;; type Ocaml_tag = Ocaml_string ;; type Ocaml_tagid_list = [ Ocaml_int* ] ;; type Ocaml_status = `Tagging_only | `Public ;; -type Ocaml_question = {| q_desc = Ocaml_string; +type Ocaml_question = { q_desc = Ocaml_string; q_author = Ocaml_string; limit_date = Ocaml_string; status = Ocaml_status; responses = [ Ocaml_response* ]; votes = [ Ocaml_vote* ]; - elected = [ Ocaml_elected* ] |} ;; -type Ocaml_xml_content = {| version = Ocaml_string; + elected = [ Ocaml_elected* ] } ;; +type Ocaml_xml_content = { version = Ocaml_string; participants = [ (Ocaml_int, Ocaml_participant)* ]; questions = [ (Ocaml_int, Ocaml_question)* ]; tags = [ (Ocaml_int, Ocaml_tag)* ]; tagged_questions = [ (Ocaml_int, - Ocaml_tagid_list)* ] |} ;; + Ocaml_tagid_list)* ] } ;; @ \section{XML export} @@ -138,7 +138,7 @@ | `Delegate -> "delegate" in map a with - (i, {| kind=q; login=l; password=p; groups=g |}) + (i, { kind=q; login=l; password=p; groups=g }) -> [ l p @@ -177,20 +177,20 @@ map l with s&Latin1 -> s in map r with - {| r_desc=d; r_author=a; r_links=l |} -> + { r_desc=d; r_author=a; r_links=l } -> [ d a !(trans_links l) ] in let trans_votes (v : [Ocaml_vote*]) : [Xml_vote*] = - map v with {| voter=id; choices=c |} -> + map v with { voter=id; choices=c } -> (map c with i&Int -> []) in let trans_elected (e : [Ocaml_elected*]) : [Xml_elected*] = map e with i&Int -> (ocaml2xml_int i) in let trans_status (Ocaml_status -> Xml_status) | `Tagging_only -> "tagging_only" | `Public -> "public" in - map a with (i,{| q_desc=d; q_author=a; limit_date=l; status=s; - responses=r; votes=v; elected=e |}) -> + map a with (i,{ q_desc=d; q_author=a; limit_date=l; status=s; + responses=r; votes=v; elected=e }) -> [ d @@ -207,7 +207,7 @@ <>= let save (f : Latin1) (c : Ocaml_xml_content) : [] = let content = match c with - {| version=v; participants=p; questions=q; tags=t; tagged_questions=tq |} -> + { version=v; participants=p; questions=q; tags=t; tagged_questions=tq } -> [ (ocaml2xml_participants p) (ocaml2xml_questions q) [ (ocaml2xml_tags t)