Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# #directory "+xml-light" (* or maybe "+site-lib/xml-light" *) ;;
# #load "xml-light.cma" ;;
# let data = [
("April", "Bubbly: I'm > Tam and <= Emily");
("Tam O'Shanter", "Burns: \"When chapman billies leave the street ...\"");
("Emily", "Short & shrift");
] in
let tags =
List.map (fun (name, comment) ->
Xml.Element ("Character", [("name", name)], [(Xml.PCData comment)])
) data
in
print_endline (
Xml.to_string_fmt (Xml.Element ("CharacterRemarks", [], tags)))
;;
<CharacterRemarks>
<Character name="April">Bubbly: I&apos;m &gt; Tam and &lt;= Emily</Character>
<Character name="Tam O'Shanter">Burns: &quot;When chapman billies leave the street ...&quot;</Character>
<Character name="Emily">Short &amp; shrift</Character>
</CharacterRemarks>
- : unit = ()

View file

@ -0,0 +1,22 @@
#directory "+xmlm"
#load "xmlm.cmo"
open Xmlm
let datas = [
("April", "Bubbly: I'm > Tam and <= Emily");
("Tam O'Shanter", "Burns: \"When chapman billies leave the street ...\"");
("Emily", "Short & shrift");
]
let xo = make_output (`Channel stdout)
let () =
output xo (`Dtd None);
output xo (`El_start (("", "CharacterRemarks"), []));
List.iter (fun (name, content) ->
output xo (`El_start (("", "Character"), [(("", "name"), name)]));
output xo (`Data content);
output xo (`El_end);
) datas;
output xo (`El_end);
print_newline()