File: test_tree.ml

package info (click to toggle)
xmlm 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 228 kB
  • sloc: ml: 1,902; makefile: 33
file content (11 lines) | stat: -rw-r--r-- 322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
let li d = `El ((("", "li"), []), [`Data d])
let frag = `El ((("", "ol"), []), [li "bli"; li "bla"; li "blo"])

let main () =
  let b = Buffer.create 233 in
  let o = Xmlm.make_output (`Buffer b) in
  Xmlm.output o (`Dtd None);
  Xmlm.output_tree (fun x -> x) o frag;
  print_endline (Buffer.contents b)

let () = main ()