-
-/**
- * Find an element in the document by id.
- */
-
-xmlNode *svgtiny_find_element_by_id(xmlNode *node, const char *id)
-{
- xmlNode *child;
- xmlNode *found;
-
- for (child = node->children; child; child = child->next) {
- xmlAttr *attr;
- if (child->type != XML_ELEMENT_NODE)
- continue;
- attr = xmlHasProp(child, (const xmlChar *) "id");
- if (attr && strcmp(id, (const char *) attr->children->content)
- == 0)
- return child;
- found = svgtiny_find_element_by_id(child, id);
- if (found)
- return found;
- }
-
- return 0;
-}
-