schema_xml.mli 2.24 KB
Newer Older
1

2
3
open Encodings

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
type pxp_node =
  ('a Pxp_document.node Pxp_document.extension as 'a) Pxp_document.node
type pxp_document =
  ('a Pxp_document.node Pxp_document.extension as 'a) Pxp_document.document

  (** create a new Pxp configuration. This configuration will be namespace
   * enabled with a brand new namespace manager containing "xsi" and "xsd"
   * schema prefixes declaration *)
val new_xsd_config : unit -> Pxp_types.config

val pxp_document_of :
  ?config: Pxp_types.config -> Pxp_types.source -> pxp_document
val pxp_node_of:
  ?config: Pxp_types.config -> Pxp_types.source -> pxp_node
val pxp_stream_of_file :
19
  ?config: Pxp_types.config -> string -> Pxp_types.event Stream.t
20

21
(* val pxp_stream_of_value : Value.t -> Pxp_yacc.event Stream.t *)
22

23
24
25
26
module Pxp_helpers:
  sig
    exception PxpHelpers of exn

27
    val _tag_name : pxp_node -> Utf8.t
28
29
30
31
32
33
34
35
36

    val _has_attribute : string -> pxp_node -> bool

      (* test if exists a child element which name is given *)
    val _has_element : string -> pxp_node -> bool

      (* test if exists a child element which name is one of the given *)
    val _has_element': string list -> pxp_node -> bool

37
    val _attribute : string -> pxp_node -> Utf8.t
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

      (* find the first child element which have the given name *)
    val _element : string -> pxp_node -> pxp_node

      (* find the first child element which name is one of the given names *)
    val _element': string list -> pxp_node -> pxp_node

      (* find all child elements which have a given name *)
    val _elements: string -> pxp_node -> pxp_node list

      (* find all child elements which name is one of the given names *)
    val _elements': string list -> pxp_node -> pxp_node list
  end

  (* namespace handling *)

54
55
56
57
open Encodings

val has_xsd_prefix : Utf8.t -> bool
val schema_ns_prefixes: (Utf8.t * Utf8.t) list
58
59
val xsd_namespace : Ns.t
val xsi_namespace : Ns.t
60
61
62
63
val xsd_prefix : Utf8.t
val xsi_prefix : Utf8.t

val add_xsd_prefix : Utf8.t -> Utf8.t
64

65
66
  (* misc stuff *)

67
val string_of_pxp_event : Pxp_types.event -> string
68

69
val collect_pcdata : Pxp_types.event Stream.t -> string
70
71

  (** @raise Stream.Failure at the end of the stream *)
72
val peek : Pxp_types.event Stream.t -> Pxp_types.event
73
74

  (* debugging only *)
75
val dump_stream : Pxp_types.event Stream.t -> unit
76