- Some node ->
- begin
- match (node#get_attribute_ns (O.o_mDOMString_of_string "xref") helmns) with
- Some xpath ->
- let annobj = get_annotated_obj () in
- let (anno, ids_to_targets, ids_to_annotations) = annobj in
- let annotation = (annotation_window#annotation : GEdit.text) in
- let id = xpath#get_string in
- current_id := Some id ;
- let ann = CicXPath.get_annotation ids_to_annotations id in
- CicAnnotationHinter.create_hints annotation_window ids_to_targets
- (xpath#get_string) ;
- annotation#delete_text 0 annotation#length ;
- begin
- match ann with
- None ->
- annotation#misc#set_sensitive false ;
- annotation_window#radio_none#set_active true ;
- radio_some_status := false
- | Some ann' ->
- annotation#insert ann' ;
- annotation#misc#set_sensitive true ;
- annotation_window#radio_some#set_active true ;
- radio_some_status := true
- end ;
- GMain.Grab.add (annotation_window#window_to_annotate#coerce) ;
- annotation_window#show () ;
- | None -> rendering_window#label#set_text ("ERROR: No xref found!!!\n")
- end
+ Some element ->
+ let xpath =
+ ((element : Gdome.element)#getAttributeNS
+ (*CSC: OCAML DIVERGE
+ ((element : G.element)#getAttributeNS
+ *)
+ ~namespaceURI:helmns
+ ~localName:(G.domString "xref"))#to_string
+ in
+ if xpath = "" then
+ rendering_window#label#set_text ("ERROR: No xref found!!!\n")
+ else
+ let annobj = get_annotated_obj () in
+ let (anno, ids_to_targets, ids_to_annotations) = annobj in
+ let annotation = (annotation_window#annotation : GEdit.text) in
+ let id = xpath in
+ current_id := Some id ;
+ let ann = CicXPath.get_annotation ids_to_annotations id in
+ CicAnnotationHinter.create_hints annotation_window ids_to_targets
+ xpath ;
+ annotation#delete_text 0 annotation#length ;
+ begin
+ match ann with
+ None ->
+ annotation#misc#set_sensitive false ;
+ annotation_window#radio_none#set_active true ;
+ radio_some_status := false
+ | Some ann' ->
+ annotation#insert ann' ;
+ annotation#misc#set_sensitive true ;
+ annotation_window#radio_some#set_active true ;
+ radio_some_status := true
+ end ;
+ GMain.Grab.add (annotation_window#window_to_annotate#coerce) ;
+ annotation_window#show () ;