File: check_dtd.ml

package info (click to toggle)
xml-light 2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 252 kB
  • sloc: ml: 1,750; xml: 42; makefile: 3
file content (13 lines) | stat: -rw-r--r-- 490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
let () =
  match Sys.argv |> Array.to_list |> List.tl with
    | [dtd; xml; main] -> (
        try
          let dtd = Dtd.parse_file dtd in
          let checked = Dtd.check dtd in
          let xml = Xml.parse_file xml in
          let xml = Dtd.prove checked main xml in
          print_endline (Xml.to_string xml)
        with Dtd.Check_error e -> print_endline (Dtd.check_error e))
    | _ ->
        print_endline "Usage: ./check_dtd.exe file.dtd file.xml entrypoint";
        exit 1