Commit 64d39068 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-03-09 22:12:11 by afrisch] Forgot to register expat for XML Schema loading

Original author: afrisch
Date: 2005-03-09 22:12:11+00:00
parent e058a6a9
......@@ -20,13 +20,13 @@ let load_from_file p s =
close_in ic
with exn -> close_in ic; raise exn
let rec load_expat s =
let rec load_expat se ee txt s =
let p = Expat.parser_create "" in
Expat.set_start_element_handler p Load_xml.start_element_handler;
Expat.set_end_element_handler p Load_xml.end_element_handler;
Expat.set_character_data_handler p Load_xml.text_handler;
Expat.set_start_element_handler p se;
Expat.set_end_element_handler p ee;
Expat.set_character_data_handler p txt;
Expat.set_external_entity_ref_handler p
(fun _ _ sys _ -> load_expat (Url.local s sys));
(fun _ _ sys _ -> load_expat se ee txt (Url.local s sys));
ignore (Expat.set_param_entity_parsing p Expat.ALWAYS);
try
if Url.is_url s then Expat.parse p (Url.load_url s)
......@@ -44,7 +44,9 @@ let rec load_expat s =
in
raise (Location.Generic msg)
let use () = Load_xml.xml_parser := load_expat
let use () = Load_xml.xml_parser :=
load_expat Load_xml.start_element_handler Load_xml.end_element_handler
Load_xml.text_handler
let () =
Config.register
......@@ -52,3 +54,6 @@ let () =
"Expat XML parser"
use
let () =
Schema_xml.xml_parser :=
(fun uri f g -> load_expat f (fun _ -> g ()) (fun _ -> ()) 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