- GdomeException exc = 0;
- GdomeDOMString* namespaceURI = gdome_str_mkref(XLINK_NS_URI);
- GdomeDOMString* localName = gdome_str_mkref("href");
-
- GdomeElement* p = gtk_math_view_get_element(math_view);
- while (p != NULL && !gdome_el_hasAttributeNS(p, namespaceURI, localName, &exc)) {
- GdomeElement* parent = gdome_cast_el(gdome_el_parentNode(p, &exc));
- g_assert(exc == 0);
- gdome_el_unref(p, &exc);
- g_assert(exc == 0);
- p = parent;
- }
- g_assert(exc == 0);
-
- if (p != NULL) {
- GdomeDOMString* href = gdome_el_getAttributeNS(p, namespaceURI, localName, &exc);
- g_assert(exc == 0);
- g_assert(href != NULL);
-
- jump(href);
- gdome_str_unref(href);
- gdome_el_unref(p, &exc);
- g_assert(exc == 0);
- } else {
- p = gtk_math_view_get_action(math_view);
- if (p != NULL) {
- gtk_math_view_action_toggle(math_view);
- gdome_el_unref(p, &exc);
- g_assert(exc == 0);
- }
- }
-
- gdome_str_unref(namespaceURI);
- gdome_str_unref(localName);