]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mlminidom/test.ml
...
[helm.git] / helm / DEVEL / mlminidom / test.ml
index 1a239f8f60abc13b97cf683720d168a84b6a0b80..a906c05527c39dceffd42702e57ce960b570c2a5 100644 (file)
@@ -32,14 +32,17 @@ let check_attribute_ns attr =
   in
   match parent,ns_uri,attr_name,attr_value with
     Some parent_node,Some uri,Some attribute_name,Some attribute_value ->
-      let attr_value = Minidom.node_get_attribute_ns parent_node attribute_name uri
+      let attr_info =
+       (Minidom.node_get_attribute_ns parent_node attribute_name uri,
+        Minidom.node_has_attribute_ns parent_node attribute_name uri)
       in begin
-        match attr_value with
-          Some attr1 ->
+        match attr_info with
+          Some attr1, true ->
            Printf.printf "found the attribute with ns %s (was %s)\n"
               (Minidom.string_of_mDOMString attr1) (Minidom.string_of_mDOMString attribute_value)
-        | None ->
+        | None, false ->
            Printf.printf "attribute not found (uri was %s)!!!!\n" (Minidom.string_of_mDOMString uri)
+        | _,_ -> assert false
       end
   | _ ->
       Printf.printf "parent_node == NULL || uri == NULL || attribute_name == NULL || attribute_value == NULL\n"
@@ -101,4 +104,3 @@ let rec print_node n node =
 ;;
   
 print_node 0 root;;
-