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"
;;
print_node 0 root;;
-