xml.mli 1.19 KB
Newer Older
Andrei Paskevich's avatar
Andrei Paskevich committed
1 2 3
(********************************************************************)
(*                                                                  *)
(*  The Why3 Verification Platform   /   The Why3 Development Team  *)
4
(*  Copyright 2010-2015   --   INRIA - CNRS - Paris-Sud University  *)
Andrei Paskevich's avatar
Andrei Paskevich committed
5 6 7 8 9
(*                                                                  *)
(*  This software is distributed under the terms of the GNU Lesser  *)
(*  General Public License version 2.1, with the special exception  *)
(*  on linking described in file LICENSE.                           *)
(********************************************************************)
MARCHE Claude's avatar
MARCHE Claude committed
10

11
type attributes = (string * string) list
MARCHE Claude's avatar
MARCHE Claude committed
12 13 14

type element =
    { name : string;
15
      attributes : attributes;
MARCHE Claude's avatar
MARCHE Claude committed
16 17 18
      elements : element list;
    }

MARCHE Claude's avatar
MARCHE Claude committed
19 20 21 22 23 24 25 26 27
type t =
    { version : string;
      encoding : string;
      doctype : string;
      dtd : string;
      content : element;
    }

exception Parse_error of string
MARCHE Claude's avatar
MARCHE Claude committed
28

29 30
val from_file : 
  ?fixattrs:(string -> attributes -> attributes) -> string -> t
MARCHE Claude's avatar
MARCHE Claude committed
31 32 33 34
  (** returns the list of XML elements from the given file.
      raise [Sys_error] if the file cannot be opened.
      raise [Parse_error] if the file does not follow XML syntax
  *)
MARCHE Claude's avatar
MARCHE Claude committed
35