| 1 |
open Encodings
|
| 2 |
|
| 3 |
|
| 4 |
module Uri : Upool.S with type value = Utf8.t
|
| 5 |
(* Namespaces URIs *)
|
| 6 |
|
| 7 |
module QName : sig
|
| 8 |
include Custom.T with type t = Uri.t * Utf8.t
|
| 9 |
|
| 10 |
val to_string: t -> string
|
| 11 |
val print: Format.formatter -> t -> unit
|
| 12 |
(*
|
| 13 |
val mk_ascii: string -> t
|
| 14 |
val get_ascii: t -> string
|
| 15 |
*)
|
| 16 |
end
|
| 17 |
|
| 18 |
module Label : sig
|
| 19 |
(* Qualified names of the form (nsuri:localname). Used
|
| 20 |
as labels in records *)
|
| 21 |
include Upool.S with type value = QName.t
|
| 22 |
val print_tag: Format.formatter -> t -> unit
|
| 23 |
val print_attr: Format.formatter -> t -> unit
|
| 24 |
|
| 25 |
val print_quote: Format.formatter -> t -> unit
|
| 26 |
val mk_ascii: string -> t
|
| 27 |
val get_ascii: t -> string
|
| 28 |
|
| 29 |
val string_of_attr: t -> string
|
| 30 |
val string_of_tag: t -> string
|
| 31 |
|
| 32 |
(*
|
| 33 |
val to_string: t -> string
|
| 34 |
val print: Format.formatter -> t -> unit
|
| 35 |
val of_qname: Uri.t -> Utf8.t -> t
|
| 36 |
val split: t -> Utf8.t * Utf8.t
|
| 37 |
*)
|
| 38 |
end
|
| 39 |
|
| 40 |
exception UnknownPrefix of Utf8.t
|
| 41 |
|
| 42 |
val empty : Uri.t
|
| 43 |
val xml_ns: Uri.t
|
| 44 |
|
| 45 |
type table (* prefix => namespace *)
|
| 46 |
val empty_table: table (* Contains only xml *)
|
| 47 |
val def_table: table (* Contains xml,xsd,xsi *)
|
| 48 |
val add_prefix: Utf8.t -> Uri.t -> table -> table
|
| 49 |
val merge_tables: table -> table -> table
|
| 50 |
val dump_table: Format.formatter -> table -> unit
|
| 51 |
|
| 52 |
val get_table: table -> (Utf8.t * Uri.t) list
|
| 53 |
val mk_table: (Utf8.t * Uri.t) list -> table
|
| 54 |
|
| 55 |
val process_start_tag:
|
| 56 |
table -> string -> (string * string) list ->
|
| 57 |
table * QName.t * (Label.t * Utf8.t) list
|
| 58 |
|
| 59 |
val map_tag: table -> Utf8.t -> QName.t
|
| 60 |
val map_attr: table -> Utf8.t -> QName.t
|
| 61 |
val map_prefix: table -> Utf8.t -> Uri.t
|
| 62 |
|
| 63 |
(* Support for printing XML documents *)
|
| 64 |
|
| 65 |
module Printer : sig
|
| 66 |
type printer
|
| 67 |
|
| 68 |
val printer: table -> printer
|
| 69 |
val register_ns: printer -> Uri.t -> unit
|
| 70 |
val register_qname: printer -> QName.t -> unit
|
| 71 |
|
| 72 |
val prefixes: printer -> (Utf8.t * Uri.t) list
|
| 73 |
val tag: printer -> QName.t -> string
|
| 74 |
val attr: printer -> QName.t -> string
|
| 75 |
end
|
| 76 |
|
| 77 |
|
| 78 |
(***)
|
| 79 |
|
| 80 |
module InternalPrinter : sig
|
| 81 |
val set_table: table -> unit
|
| 82 |
|
| 83 |
val any_ns: Uri.t -> string
|
| 84 |
val tag: QName.t -> string
|
| 85 |
val attr: QName.t -> string
|
| 86 |
|
| 87 |
val print_tag: Format.formatter -> QName.t -> unit
|
| 88 |
val print_any_ns: Format.formatter -> Uri.t -> unit
|
| 89 |
|
| 90 |
val dump: Format.formatter -> unit
|
| 91 |
end
|
| 92 |
|
| 93 |
|