Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
462f941f
Commit
462f941f
authored
Jul 10, 2007
by
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
7f8478e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
runtime/load_xml.ml
View file @
462f941f
...
...
@@ -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
;
...
...
runtime/load_xml.mli
View file @
462f941f
val
use_parser
:
[
`Expat
|
`Pxp
]
ref
val
expat_support
:
bool
val
curl_support
:
bool
val
load_xml
:
string
->
Value
.
t
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment