Commit 38c3c2b1 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-08-29 12:43:01 by afrisch] Update to OCaml 3.08.1 and latest pxp (break namespaces in Schema

support -> to be fixed)

Original author: afrisch
Date: 2004-08-29 12:43:01+00:00
parent 1fe030ba
open Pxp_yacc
open Pxp_lexer_types
open Pxp_types
open Pxp_ev_parser
let pxp_handle_event = function
| E_start_tag (name,att,_) -> Load_xml.start_element_handler name att
| E_start_tag (name,att,_,_) -> Load_xml.start_element_handler name att
| E_char_data data -> Load_xml.text_handler data
| E_end_tag (_,_) -> Load_xml.end_element_handler ()
| _ -> ()
......
......@@ -543,6 +543,10 @@ class lazy_resolver =
(fun (p, ns) ->
namespace_manager#add_namespace (Utf8.get_str p) (Utf8.get_str ns))
Schema_xml.schema_ns_prefixes;
(*
Need to do something about that...
List.iter
(fun n ->
let prefix = get_ns_prefix n in
......@@ -552,6 +556,7 @@ class lazy_resolver =
ignore (namespace_manager#lookup_or_add_namespace prefix uri)
end)
root#namespace_info#declaration;
*)
if _has_attribute "targetNamespace" root then begin
let ns = _attribute "targetNamespace" root in
targetNamespace <- Some ns;
......@@ -815,9 +820,12 @@ let schema_of_node root =
}
let parse_schema source =
(*
let config =
{ new_xsd_config () with Pxp_types.enable_namespace_info = true }
in
*)
let config = new_xsd_config () in
let schema = schema_of_node (pxp_node_of ~config source) in
debug_print "parse_schema completed successfully";
schema
......
......@@ -110,9 +110,9 @@ let pxp_stream_of_value v =
open Printf
let string_of_pxp_event = function
| E_start_doc (version, standalone, dtd) -> "E_start_doc"
| E_end_doc -> "E_end_doc"
| E_start_tag (name, attlist, entity_id) -> sprintf "E_start_tag (%s)" name
| E_start_doc (version, dtd) -> "E_start_doc"
| E_end_doc _ -> "E_end_doc"
| E_start_tag (name, attlist, _, entity_id) -> sprintf "E_start_tag (%s)" name
| E_end_tag (name, entity_id) -> sprintf "E_end_tag (%s)" name
| E_char_data data ->
sprintf "E_char_data (%s)" (Pcre.replace ~pat:"\n" ~templ:"\\n" data)
......
......@@ -16,7 +16,7 @@ val pxp_document_of :
val pxp_node_of:
?config: Pxp_types.config -> Pxp_types.source -> pxp_node
val pxp_stream_of_file :
?config: Pxp_types.config -> string -> Pxp_yacc.event Stream.t
?config: Pxp_types.config -> string -> Pxp_types.event Stream.t
(* val pxp_stream_of_value : Value.t -> Pxp_yacc.event Stream.t *)
......@@ -64,13 +64,13 @@ val add_xsd_prefix : Utf8.t -> Utf8.t
(* misc stuff *)
val string_of_pxp_event : Pxp_yacc.event -> string
val string_of_pxp_event : Pxp_types.event -> string
val collect_pcdata : Pxp_yacc.event Stream.t -> string
val collect_pcdata : Pxp_types.event Stream.t -> string
(** @raise Stream.Failure at the end of the stream *)
val peek : Pxp_yacc.event Stream.t -> Pxp_yacc.event
val peek : Pxp_types.event Stream.t -> Pxp_types.event
(* debugging only *)
val dump_stream : Pxp_yacc.event Stream.t -> unit
val dump_stream : Pxp_types.event Stream.t -> unit
......@@ -1661,7 +1661,7 @@ let get_schema uri =
Hashtbl.add !schema_types (uri, name) cd_type)
schema.Schema_types.types;
List.iter (* Schema attributes -> CDuce types *)
(fun (name, _, _) as att_decl ->
(fun ((name, _, _) as att_decl) ->
let cd_type = Schema_converter.cd_type_of_att_decl ~schema att_decl in
log_schema_component "attribute" uri name cd_type;
Hashtbl.add !schema_attributes (uri, name) cd_type)
......
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