schema_common.mli 3.76 KB
Newer Older
1
2
3

(** Schema common functionalities depending only on Schema_types *)

4
open Encodings
5
6
open Schema_types

7
(** {2 Exceptions} *)
8
9

exception XSD_validation_error of string
10
exception XSI_validation_error of string
11
12
13
14
15
16
17
18
19

(** {2 XSD printer *)

val print_schema : Format.formatter -> schema -> unit
val print_type : Format.formatter -> type_definition -> unit
val print_attribute : Format.formatter -> attribute_declaration -> unit
val print_element : Format.formatter -> element_declaration -> unit
val print_attribute_group :
  Format.formatter -> attribute_group_definition -> unit
20
val print_model_group_def : Format.formatter -> model_group_definition -> unit
21
22
23
24
25
val print_simple_type : Format.formatter -> simple_type_definition -> unit
val print_complex_type : Format.formatter -> complex_type_definition -> unit

(** {2 Deconstruction functions} *)

26
27
val get_simple_type: type_ref -> simple_type_definition

28
29
30
31
32
33
34
35
36
val name_of_element_declaration : element_declaration -> Ns.qname
val name_of_type_definition : type_definition -> Ns.qname
val name_of_simple_type_definition : simple_type_definition -> Ns.qname
val name_of_complex_type_definition : complex_type_definition -> Ns.qname
val name_of_attribute_declaration : attribute_declaration -> Ns.qname
val name_of_attribute_use : attribute_use -> Ns.qname
val name_of_attribute_group_definition : attribute_group_definition -> Ns.qname
val name_of_model_group_definition : model_group_definition -> Ns.qname
val name_of_particle : particle -> Ns.qname
37
38
39

val string_of_component_kind : component_kind -> string

40
41
42
43
44
45
val variety_of_simple_type_definition : simple_type_definition -> variety
val facets_of_simple_type_definition : simple_type_definition -> facets
val simple_type_of_type : type_definition -> simple_type_definition
val complex_type_of_type : type_definition -> complex_type_definition
val content_type_of_type : type_definition -> content_type

46
47
48
49
50
51
52
(*
val get_type: Ns.qname -> schema -> type_definition
val get_attribute: Ns.qname -> schema -> attribute_declaration
val get_element: Ns.qname -> schema -> element_declaration
val get_attribute_group: Ns.qname -> schema -> attribute_group_definition
val get_model_group: Ns.qname -> schema -> model_group_definition
*)
53

54
55
val get_component: component_kind -> Ns.qname -> schema -> component
val get_unqual_component: component_kind -> Utf8.t -> schema -> component
56

57
58
59
60
61
62
63
val iter_types: schema -> (type_definition -> unit) -> unit
val iter_attributes: schema -> (attribute_declaration -> unit) -> unit
val iter_elements: schema -> (element_declaration -> unit) -> unit
val iter_attribute_groups:
  schema -> (attribute_group_definition -> unit) -> unit
val iter_model_groups: schema -> (model_group_definition -> unit) -> unit

64
val first_of_particle: particle -> Ns.qname list
65
val nullable: particle -> bool
66
67
val first_of_model_group: model_group -> Ns.qname list
val nullable_of_model_group: model_group -> bool
68

69
70
71
72
(** {2 Facets} *)

val merge_facets: facets -> facets -> facets

73
74
val normalize_simple_type: simple_type_definition -> simple_type_definition

75

76
(** {2 Miscellaneous} *) 
77
78
79
80
81
82
83
84
85
86
87
88
  (** empty set of facets (with the only exception of "whiteSpace", which is set
  to <`Collapse, true>, the mandatory value for all non string derived simple
  types) *)

val no_facets: facets
val anySimpleType: simple_type_definition
val anyType: type_definition

  (** @return the integer interval corrisponding to boundary facets *)
val get_interval: facets -> Intervals.t

  (** perform white space normalization according to XML recommendation *)
89
90
val normalize_white_space: white_space_handling -> Utf8.t -> Utf8.t

91
(** {2 event interface on top of CDuce values} *)
92

93
val stream_of_value: Value.t -> event Stream.t
94
val string_of_event: event -> string
95

96
97
98
99


val print_model_group: Format.formatter -> model_group -> unit
val print_particle: Format.formatter -> particle -> unit