schema_common.mli 4.1 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
37
38
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
39
40
41

val string_of_component_kind : component_kind -> string

42
43
44
45
46
47
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

48
49
50
51
52
53
54
(*
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
*)
55

56
val get_component: component_kind -> Ns.qname -> schema -> component
57

58
59
60
61
62
63
64
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

65
66
67
68
val first_of_wildcard_constraint: wildcard_constraint -> Atoms.t
val first_of_particle: particle -> Atoms.t
val first_of_model_group: model_group -> Atoms.t

69
val nullable: particle -> bool
70
val nullable_of_model_group: model_group -> bool
71

72
73
74
75
(** {2 Facets} *)

val merge_facets: facets -> facets -> facets

76
(*
77
val normalize_simple_type: simple_type_definition -> simple_type_definition
78
*)
79

80
(** {2 Miscellaneous} *) 
81
82
83
84
85
86
87
88
89
90
91
  (** 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 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 *)
92
93
val normalize_white_space: white_space_handling -> Utf8.t -> Utf8.t

94
(** {2 event interface on top of CDuce values} *)
95

96
val stream_of_value: Value.t -> event Stream.t
97
val string_of_event: event -> string
98

99
100
101
102


val print_model_group: Format.formatter -> model_group -> unit
val print_particle: Format.formatter -> particle -> unit
103
104
105
106
107
108
109
110
111
112



val simple_restrict: 
  Ns.qname option -> simple_type_definition -> facets -> simple_type_definition
val simple_list: 
  Ns.qname option -> simple_type_definition -> simple_type_definition
val simple_union: 
  Ns.qname option -> simple_type_definition list -> simple_type_definition

113
114
115
116
117

val xsi_nil_type: Types.t
val xsi_nil_qname: Ns.qname
val xsi_nil_atom: Atoms.V.t
val xsi_nil_label: Ident.label