Commit 5d86b7fc authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-07-06 14:27:21 by afrisch] Empty log message

Original author: afrisch
Date: 2004-07-06 14:27:22+00:00
parent 346ee54e
...@@ -174,19 +174,19 @@ unary_op_cst "string_of" ...@@ -174,19 +174,19 @@ unary_op_cst "string_of"
Value.string_latin1 (Buffer.contents b) Value.string_latin1 (Buffer.contents b)
);; );;
unary_op_cst "load_xml" unary_op_warning "load_xml"
string any string string_latin1 any
(fun v -> Load_xml.load_xml (Value.get_string_latin1 v));; (fun v -> Load_xml.load_xml (Value.get_string_latin1 v));;
unary_op_cst "load_html" unary_op_warning "load_html"
string Sequence.any string string_latin1 Sequence.any
(fun v -> Load_xml.load_html (Value.get_string_latin1 v));; (fun v -> Load_xml.load_html (Value.get_string_latin1 v));;
unary_op_cst "load_file_utf8" unary_op_warning "load_file_utf8"
string string string string_latin1 string
(eval_load_file ~utf8:true);; (eval_load_file ~utf8:true);;
unary_op_cst "load_file" string string_latin1 unary_op_warning "load_file" string string_latin1 string_latin1
(eval_load_file ~utf8:false);; (eval_load_file ~utf8:false);;
......
...@@ -447,10 +447,18 @@ file system; the argument gives the filename:</p> ...@@ -447,10 +447,18 @@ file system; the argument gives the filename:</p>
load_xml %%e%% load_xml %%e%%
]]></sample> ]]></sample>
<p>
The argument to <code>load_xml</code> is a Latin1 string (the type
system will issue a warning if the argument is of type
<code>String</code> but not <code>Latin1</code>, and an
exception might be raised at runtime).
</p>
<p> <p>
If the support for netclient or curl is available, it is also If the support for netclient or curl is available, it is also
possible to fetch an XML file from an URL, e.g.: possible to fetch an XML file from an URL, e.g.:
<code>load_xml "http://..."</code>. <code>load_xml "http://..."</code>. A special <code>string://</code>
is always supported: the string following the scheme is parsed as it.
</p> </p>
<p> <p>
......
...@@ -59,16 +59,16 @@ _" character, starting by a capitalized letter or underscore.</li> ...@@ -59,16 +59,16 @@ _" character, starting by a capitalized letter or underscore.</li>
<br/> <code>not</code>: Bool -> Bool <br/> <code>not</code>: Bool -> Bool
</li> </li>
<li>Prefix: <li>Prefix:
<br/><code>load_xml</code> : String -> Any, <br/><code>load_xml</code> : Latin1 -> Any,
<br/><code>load_html</code> : String -> [ Any* ], <br/><code>load_html</code> : Latin1 -> [ Any* ],
<br/><code>load_file</code> : String -> Latin1, <br/><code>load_file</code> : Latin1 -> Latin1,
<br/><code>load_file_utf8</code> : String -> String, <br/><code>load_file_utf8</code> : Latin1 -> String,
<br/><code>argv</code> : [] -> [ String* ], <br/><code>argv</code> : [] -> [ String* ],
<br/><code>dump_to_file</code> : String -> String -> [], <br/><code>dump_to_file</code> : Latin1 -> String -> [],
<br/><code>dump_to_file_utf8</code> : String -> String -> [], <br/><code>dump_to_file_utf8</code> : Latin1 -> String -> [],
<br/><code>print_xml</code> : Any -> Latin1, <br/><code>print_xml</code> : Any -> Latin1,
<br/><code>print_xml_utf8</code> : Any -> String, <br/><code>print_xml_utf8</code> : Any -> String,
<br/><code>print</code> : String -> [], <br/><code>print</code> : Latin1 -> [],
<br/><code>int_of</code> : String -> Integer, <br/><code>int_of</code> : String -> Integer,
<br/><code>string_of</code> : Any -> Latin1, <br/><code>string_of</code> : Any -> Latin1,
<br/><code>atom_of</code> : String -> Atom <br/><code>atom_of</code> : String -> Atom
......
...@@ -68,12 +68,12 @@ type InlineText = ...@@ -68,12 +68,12 @@ type InlineText =
(* Recursive inclusion of XML files and verbatim text files *) (* Recursive inclusion of XML files and verbatim text files *)
let load_include (String -> [Any*]) let load_include (Latin1 -> [Any*])
name -> name ->
(* let _ = print [ 'Loading ' !name '... \n' ] in *) (* let _ = print [ 'Loading ' !name '... \n' ] in *)
xtransform [ (load_xml name) ] with xtransform [ (load_xml name) ] with
| <include file=(s & String)>[] -> load_include s | <include file=(s & Latin1)>[] -> load_include s
| <include-verbatim file=(s & String)>[] -> load_file s | <include-verbatim file=(s & Latin1)>[] -> load_file s
(* Highlighting text between {{...}} *) (* Highlighting text between {{...}} *)
......
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