crm_debug("converting tags to xml");  update     = string2xml(update_s); pre_update = string2xml(pre_update_s); xml_text   = dump_xml_formatted(update);
update     = get_message_xml(msg, F_CIB_UPDATE); pre_update = get_message_xml(msg, F_CIB_EXISTING);  if(update != NULL) { xml_text   = dump_xml_formatted(update); }
cibmon_pre_notify(const char *event, HA_Message *msg) {	int rc = -1;	const char *op       = NULL;	const char *id       = NULL; 	const char *type     = NULL;	const char *update_s = NULL;	const char *pre_update_s = NULL;	crm_data_t *update     = NULL;	crm_data_t *pre_update = NULL;	char *xml_text         = NULL;	if(msg == NULL) {		crm_err("NULL update");		return;	}		op       = cl_get_string(msg, F_CIB_OPERATION);	id       = cl_get_string(msg, F_CIB_OBJID);	type     = cl_get_string(msg, F_CIB_OBJTYPE);	update_s = cl_get_string(msg, F_CIB_UPDATE);	pre_update_s = cl_get_string(msg, F_CIB_EXISTING);	crm_debug("converting tags to xml");		update     = string2xml(update_s);	pre_update = string2xml(pre_update_s);	xml_text   = dump_xml_formatted(update);		ha_msg_value_int(msg, F_CIB_RC, &rc);	update_depth++;	last_notify_pre = TRUE;		if(update_depth > 1 && intermediate_changes == FALSE) {		crm_trace("[%s] Ignoring intermediate update", event);		return;	}		fprintf(msg_cibmon_strm, "[%s] Raw update for %s (to %s)\n%s\n",		event, op, crm_str(type), update_s);	if(update != NULL) {		crm_verbose("[%s] Performing %s on <%s%s%s>",			    event, op, type, id?" id=":"", id?id:"");		fprintf(msg_cibmon_strm, "[%s] Performing %s to <%s%s%s>."			"  Update follows\n%s\n",			event, op, crm_str(type), id?" id=":"", id?id:"",			xml_text);	} else if(update_s == NULL && update == NULL) {		crm_verbose("[%s] Performing operation %s (on section=%s)",			    event, op, type);		fprintf(msg_cibmon_strm, "[%s] Performing %s (to %s)\n",			event, op, crm_str(type));	} else {		crm_err("[%s] Couldnt convert update for %s (to %s)",			event, op, crm_str(type));		fprintf(msg_cibmon_strm,			"[%s] ERROR: Couldnt convert update for %s (to %s)\n",			event, op, crm_str(type));	}	crm_free(xml_text);	xml_text = dump_xml_formatted(pre_update);	fprintf(msg_cibmon_strm, "[%s] Existing object\n%s\n",		event, xml_text);	fflush(msg_cibmon_strm);	crm_free(xml_text);}