Commit d37272f3 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-02-18 17:42:19 by afrisch] import

Original author: afrisch
Date: 2005-02-18 17:42:19+00:00
parent c272c7ec
...@@ -199,7 +199,7 @@ let schema_of_uri uri = ...@@ -199,7 +199,7 @@ let schema_of_uri uri =
let elementFormDefault = let elementFormDefault =
_is_attr "elementFormDefault" root "qualified" in _is_attr "elementFormDefault" root "qualified" in
let parse_root root = let rec parse_root uri root =
let may_name n = let may_name n =
match _may_attr "name" n with match _may_attr "name" n with
...@@ -579,9 +579,20 @@ let schema_of_uri uri = ...@@ -579,9 +579,20 @@ let schema_of_uri uri =
todo := (fun () -> ignore (resolve_model_group name)):: !todo todo := (fun () -> ignore (resolve_model_group name)):: !todo
| "xsd:include" -> | "xsd:include" ->
let local = _attr "schemaLocation" n in let local = _attr "schemaLocation" n in
let new_uri = Url.local uri (Utf8.get_str local) in let uri = Url.local uri (Utf8.get_str local) in
print_endline ("Fetching " ^ new_uri); flush stdout; print_endline ("Include " ^ uri); flush stdout;
ignore (parse_uri new_uri); parse_root uri (node_of_uri uri);
| "xsd:import" ->
(match _may_attr "schemaLocation" n with
| None ->
print_endline "Import ignored, no schemaLocation"
| Some local ->
let new_uri = Url.local uri (Utf8.get_str local) in
print_endline ("Import " ^ new_uri); flush stdout;
ignore (parse_uri new_uri)
)
(* TODO: check namespace *)
| "xsd:annotation" -> ()
| s -> print_endline ("Ignore Schema element " ^ s); | s -> print_endline ("Ignore Schema element " ^ s);
in in
_iter_elems root register; _iter_elems root register;
...@@ -589,7 +600,7 @@ let schema_of_uri uri = ...@@ -589,7 +600,7 @@ let schema_of_uri uri =
(* end of parse_root *) (* end of parse_root *)
in in
parse_root root; parse_root uri root;
targetNamespace targetNamespace
(* end of parse_uri *) (* end of parse_uri *)
......
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