Commit 71feb63f authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-03-13 16:16:01 by afrisch] Clean

Original author: afrisch
Date: 2005-03-13 16:16:01+00:00
parent cabc78a5
......@@ -150,11 +150,9 @@ let stream_of_value v =
stack)
(Value.get_fields attrs);
Some (E_start_tag (Atoms.V.value atom))
| (Half (Value.Xml (Value.Atom atom, _, _))) :: tl ->
| Half _ :: tl ->
stack := tl;
Some (E_end_tag (Atoms.V.value atom))
| (Fully (Value.Xml (_, _, _)))::_ | (Half (Value.Xml (_, _, _)))::_ ->
Value.failwith' "Validate: non XML element"
Some E_end_tag
| (Backlog ev) :: tl -> (* consume backlog *)
stack := tl;
Some ev
......@@ -168,7 +166,7 @@ let stream_of_value v =
let string_of_event = function
| E_start_tag qname -> sprintf "<%s>" (Ns.QName.to_string qname)
| E_end_tag qname -> sprintf "</%s>" (Ns.QName.to_string qname)
| E_end_tag -> sprintf "</>"
| E_attribute (qname, value) ->
sprintf "@%s=%s" (Ns.QName.to_string qname) (Utf8.to_string value)
| E_char_data value -> Utf8.to_string value
......
......@@ -28,7 +28,8 @@ type facets = {
}
and value_ref = Value.t
and value_constraint = [ `Fixed of Utf8.t * Value.t | `Default of Utf8.t * Value.t ]
and value_constraint =
[ `Fixed of Utf8.t * Value.t | `Default of Utf8.t * Value.t ]
and type_ref = type_definition Lazy.t
......@@ -130,6 +131,6 @@ type schema = {
type event =
| E_start_tag of Ns.qname
| E_end_tag of Ns.qname
| E_end_tag
| E_attribute of Ns.qname * Utf8.t
| E_char_data of Utf8.t
......@@ -131,6 +131,6 @@ type schema = {
type event =
| E_start_tag of Ns.qname
| E_end_tag of Ns.qname
| E_end_tag
| E_attribute of Ns.qname * Utf8.t
| E_char_data of Utf8.t
......@@ -111,17 +111,17 @@ let do_pcdata ctx =
let expect_end_tag ctx =
match next ctx with
| E_end_tag _ -> ()
| E_end_tag -> ()
| ev -> error (sprintf "Expected end tag, found %s" (string_of_event ev))
let is_end_tag ctx =
match peek ctx with
| E_end_tag _ -> true
| E_end_tag -> true
| ev -> false
let check_nil ctx =
match peek ctx with
| E_end_tag _ -> ()
| E_end_tag -> ()
| ev -> error (sprintf "Non-empty content with xsi:nil set : %s"
(string_of_event ev))
......@@ -307,7 +307,7 @@ let rec validate_any_type ctx =
expect_end_tag ctx;
append ctx (xml qname attrs content);
aux ()
| E_end_tag _ -> ()
| E_end_tag -> ()
| _ -> assert false
in
aux ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment