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

[r2003-12-03 11:35:18 by beppe] CURL support optional

Original author: beppe
Date: 2003-12-03 11:35:18+00:00
parent 2701a6ad
......@@ -5,6 +5,11 @@ ifdef EXPAT then
else
let expat_support = false
ifdef CURL then
let curl_support = true
else
let curl_support = false
let use_parser = ref (if expat_support then `Expat else `Pxp)
open Pxp_yacc
......@@ -100,12 +105,18 @@ let load_expat =
let buf = String.create buflen in
fun s ->
let ic =
try open_in s
with exn ->
if Url.is_url then
let msg =
Printf.sprintf "load_xml, file \"%s\": %s" s (Printexc.to_string exn)
Printf.sprintf "load_xml, file \"%s\": URLs support is not available for expat, yet." s
in
raise (Location.Generic msg)
else
try open_in s
with exn ->
let msg =
Printf.sprintf "load_xml, file \"%s\": %s" s (Printexc.to_string exn)
in
raise (Location.Generic msg)
in
let p = Expat.parser_create "" in
Expat.set_start_element_handler p start_element_handler;
......
val use_parser: [ `Expat | `Pxp ] ref
val expat_support : bool
val curl_support : bool
val load_xml: string -> Value.t
......
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