void gf_dom_event_dump_listeners(GF_Node *n, FILE *f)
{
	u32		i;
	u32		count;
	GF_List *listeners = NULL;
	GF_FieldInfo info;

	/*re-translate dynamically created listeners/handlers */
	if (n && n->sgprivate && n->sgprivate->interact && n->sgprivate->interact->dom_evt) {
		listeners = n->sgprivate->interact->dom_evt->listeners;
		count = gf_list_count(listeners);
		for (i=0; i<count; i++) {
			SVG_handlerElement *hdl;
			GF_Node *listener = (GF_Node *)gf_list_get(listeners, i);
			/*this listener has been created for internal use*/
			if (listener->sgprivate->parents) continue;
			if (gf_node_get_attribute_by_tag(listener, TAG_XMLEV_ATT_handler, GF_FALSE, GF_FALSE, &info)==GF_OK) {
				GF_DOMText *txt;
				hdl = (SVG_handlerElement *) ((XMLRI*)info.far_ptr)->target;
				if (!hdl) continue;
				/*this handler was declared in the graph*/
				if (hdl->sgprivate->parents
				        && (hdl->sgprivate->parents->next || (hdl->sgprivate->parents->node != listener))
				   )
					continue;

				txt = hdl->children ? (GF_DOMText*)hdl->children->node : NULL;
				if (!txt || (txt->sgprivate->tag!=TAG_DOMText) || !txt->textContent) continue;
				if (gf_node_get_attribute_by_tag((GF_Node*)hdl, TAG_XMLEV_ATT_event, GF_FALSE, GF_FALSE, &info)==GF_OK) {
					gf_fprintf(f, " on%s=\"%s\"", gf_dom_event_get_name( ((XMLEV_Event*)info.far_ptr)->type), txt->textContent);
				}
			}
		}
	}
}
void gf_dom_event_dump_listeners(GF_Node *n, FILE *f)
{
	u32		i;
	u32		count;
	GF_List *listeners = NULL;
	GF_FieldInfo info;

	 
	if (n && n->sgprivate && n->sgprivate->interact && n->sgprivate->interact->dom_evt) {
		listeners = n->sgprivate->interact->dom_evt->listeners;
		count = gf_list_count(listeners);
		for (i=0; i<count; i++) {
			SVG_handlerElement *hdl;
			GF_Node *listener = (GF_Node *)gf_list_get(listeners, i);
			 
			if (listener->sgprivate->parents) continue;
			if (gf_node_get_attribute_by_tag(listener, TAG_XMLEV_ATT_handler, GF_FALSE, GF_FALSE, &info)==GF_OK) {
				GF_DOMText *txt;
				hdl = (SVG_handlerElement *) ((XMLRI*)info.far_ptr)->target;
				if (!hdl) continue;
				 
				if (hdl->sgprivate->parents
				        && (hdl->sgprivate->parents->next || (hdl->sgprivate->parents->node != listener))
				   )
					continue;

				txt = hdl->children ? (GF_DOMText*)hdl->children->node : NULL;
				if (!txt || (txt->sgprivate->tag!=TAG_DOMText) || !txt->textContent) continue;
				if (gf_node_get_attribute_by_tag((GF_Node*)hdl, TAG_XMLEV_ATT_event, GF_FALSE, GF_FALSE, &info)==GF_OK) {
					gf_fprintf(f, " on%s=\"%s\"", gf_dom_event_get_name( ((XMLEV_Event*)info.far_ptr)->type), txt->textContent);
				}
			}
		}
	}
}