Change-Id: I069750a6d02ca7967daeeee1b01dbdb082221146
}
/* search the element node of id. NOTE : not optimized at all */
}
/* search the element node of id. NOTE : not optimized at all */
-static xmlNodePtr search_id(const char *id)
+static xmlNodePtr search_for(const char *attrname, const char *value)
{
char *val;
xmlNodePtr iter, next;
{
char *val;
xmlNodePtr iter, next;
result = NULL;
iter = xmlDocGetRootElement(document);
while (iter != NULL) {
result = NULL;
iter = xmlDocGetRootElement(document);
while (iter != NULL) {
- val = xmlGetProp(iter, "Id");
- if (val != NULL && !strcmp(val, id)) {
+ val = xmlGetProp(iter, attrname);
+ if (val != NULL && !strcmp(val, value)) {
- syslog(LOG_ERR, "duplicated Id %s", id);
+ syslog(LOG_ERR, "duplicated %s %s", attrname, value);
free(val);
return NULL;
}
free(val);
return NULL;
}
iter = next;
}
if (result == NULL)
iter = next;
}
if (result == NULL)
- syslog(LOG_ERR, "node of Id '%s' not found", id);
+ syslog(LOG_ERR, "node of %s '%s' not found", attrname, value);
+
+/* search the element node of id. NOTE : not optimized at all */
+static xmlNodePtr search_id(const char *id)
+{
+ return search_for("Id", id);
+}
#endif
/* check the digest of one element */
#endif
/* check the digest of one element */