Commit 149fc662 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-20 21:22:39 by cvscast] Empty log message

Original author: cvscast
Date: 2003-05-20 21:22:39+00:00
parent 413e7dc9
......@@ -12,7 +12,7 @@ open Encodings
let is_ws s =
let rec check i =
(i < 0) ||
(match s.[i] with
(match (String.unsafe_get s i) with
| ' ' | '\t' | '\n' | '\r' -> check (i - 1)
| _ -> false) in
check (String.length s - 1)
......@@ -70,17 +70,20 @@ let load_xml_aux s =
match !curr with
| E_start_tag (name,att,_) ->
get ();
dump_txt (fun () ->
let e1 = parse_elt name att in
let rest = parse_seq () in
Pair (e1, rest)
)
let data = Buffer.contents txt in
Buffer.clear txt;
let e1 = parse_elt name att in
let rest = parse_seq () in
let q = Pair (e1,rest) in
if (is_ws data) then q else string data q
| E_char_data data ->
get();
Buffer.add_string txt data;
parse_seq ()
| E_end_tag (_,_) ->
dump_txt (fun () -> nil)
let data = Buffer.contents txt in
Buffer.clear txt;
if (is_ws data) then nil else string data nil
| _ -> failwith "Expect start_tag, char_data, or end_tag"
and parse_doc () =
......
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