From 22a8ad8462e81ad68d8016a009fa8003bd52a66f Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Tue, 22 Jul 2003 15:51:33 +0000 Subject: [PATCH] Debugging stuff changed. --- helm/gTopLevel/xmlDiff.ml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/helm/gTopLevel/xmlDiff.ml b/helm/gTopLevel/xmlDiff.ml index 50073f929..3d9bb39ac 100644 --- a/helm/gTopLevel/xmlDiff.ml +++ b/helm/gTopLevel/xmlDiff.ml @@ -23,6 +23,9 @@ * http://cs.unibo.it/helm/. *) +let myprerr_endline = prerr_endline;; +let prerr_endline _ = ();; + let update_dom ~(from : Gdome.document) (d : Gdome.document) = let rec aux (p: Gdome.node) (f: Gdome.node) (t: Gdome.node) = (* Perche' non andava? @@ -62,7 +65,7 @@ prerr_endline ("XML_DIFF: preservo il nodo "^ nu#to_string ^ ":" ^ln#to_string); let name = attr#get_nodeName in match tattrs#getNamedItem ~name with None -> -prerr_endline ("XML_DIFF: rimuovo l'attributo " ^ name#to_string); +myprerr_endline ("XML_DIFF: rimuovo l'attributo " ^ name#to_string); ignore (f#removeChild attr) | Some attr' -> processed := @@ -77,8 +80,8 @@ prerr_endline ("XML_DIFF: rimuovo l'attributo " ^ name#to_string); -> prerr_endline ("XML_DIFF: DOM 1; preservo l'attributo " ^ name#to_string); () - | Some _, Some _ -> -prerr_endline ("XML_DIFF: DOM 1; rimpiazzo l'attributo " ^ name#to_string); + | Some v1, Some v2 -> +myprerr_endline ("XML_DIFF: DOM 1; rimpiazzo l'attributo " ^ name#to_string ^ ": old value=" ^ v1#to_string ^ ", new value=" ^ v2#to_string); let attr'' = from#importNode attr' true in ignore (fattrs#setNamedItem attr'') | _,_ -> assert false @@ -93,7 +96,7 @@ prerr_endline ("XML_DIFF: DOM 1; rimpiazzo l'attributo " ^ name#to_string); tattrs#getNamedItemNS ~namespaceURI ~localName with None -> -prerr_endline ("XML_DIFF: rimuovo l'attributo " ^ localName#to_string); +myprerr_endline ("XML_DIFF: rimuovo l'attributo " ^ localName#to_string); ignore (f#removeChild attr) | Some attr' -> processed := @@ -109,7 +112,7 @@ prerr_endline ("XML_DIFF: rimuovo l'attributo " ^ localName#to_string); prerr_endline ("XML_DIFF: DOM 2; preservo l'attributo " ^ namespaceURI#to_string ^ ":" ^ localName#to_string); () | Some _, Some _ -> -prerr_endline ("XML_DIFF: DOM 2; rimpiazzo l'attributo " ^ namespaceURI#to_string ^ ":" ^ localName#to_string); +myprerr_endline ("XML_DIFF: DOM 2; rimpiazzo l'attributo " ^ namespaceURI#to_string ^ ":" ^ localName#to_string); let attr'' = from#importNode attr' true in ignore (fattrs#setNamedItem attr'') | _,_ -> assert false @@ -150,7 +153,7 @@ debugs := ("XML_DIFF: DOM 2.0; creo un nuovo attributo " ^ namespaceURI#to_strin ) !processed) then let attr' = from#importNode attr false in -prerr_endline !debugs ; +myprerr_endline !debugs ; ignore (fattrs#setNamedItem attr') done | _,_ -> assert false @@ -165,14 +168,14 @@ prerr_endline "XML_DIFF: processo una coppia di figli" ; aux f he1 he2 ; dumb_diff (tl1,tl2) | [],tl2 -> -prerr_endline "XML_DIFF: appendo i nodi residui" ; +myprerr_endline "XML_DIFF: appendo i nodi residui" ; List.iter (function n -> let n' = from#importNode n true in ignore (f#appendChild n') ) tl2 | tl1,[] -> -prerr_endline "XML_DIFF: cancello i nodi residui" ; +myprerr_endline "XML_DIFF: cancello i nodi residui" ; List.iter (function n -> ignore (f#removeChild n)) tl1 in let node_list_of_nodeList nl = @@ -203,7 +206,7 @@ prerr_endline("XML_DIFF: to ha " ^ string_of_int tchildren#get_length ^ " nodi (t1 = GdomeNodeTypeT.ELEMENT_NODE || t1 = GdomeNodeTypeT.TEXT_NODE) && (t2 = GdomeNodeTypeT.ELEMENT_NODE || t2 = GdomeNodeTypeT.TEXT_NODE) -> let t' = from#importNode t true in -prerr_endline "XML_DIFF: importo il nodo" ; +myprerr_endline "XML_DIFF: importo il nodo" ; (* prerr_endline ("Rimpiazzo" ^ (match f#get_namespaceURI with Some s -> s#to_string) ^ ":" ^ (match f#get_localName with Some s -> s#to_string) ^ " con " ^ (match t#get_namespaceURI with Some s -> s#to_string) ^ ":" ^ (match t#get_localName with Some s -> s#to_string) ^ " in " ^ (match p#get_localName with Some s -> s#to_string | None -> "_")) ; *) -- 2.39.2