| 1357 | } |
| 1358 | |
| 1359 | gboolean |
| 1360 | can_prune_leaf(xmlNode *xml_node) |
| 1361 | { |
| 1362 | xmlNode *child = NULL; |
| 1363 | xmlAttrPtr pIter = NULL; |
| 1364 | gboolean can_prune = TRUE; |
| 1365 | |
| 1366 | for(pIter = crm_first_attr(xml_node); pIter != NULL; pIter = pIter->next) { |
| 1367 | const char *p_name = (const char *)pIter->name; |
| 1368 | if(strcmp(p_name, XML_ATTR_ID) == 0) { |
| 1369 | continue; |
| 1370 | } |
| 1371 | can_prune = FALSE; |
| 1372 | } |
| 1373 | |
| 1374 | for(child = __xml_first_child(xml_node); child != NULL; child = __xml_next(child)) { |
| 1375 | if(can_prune_leaf(child)) { |
| 1376 | free_xml(child); |
| 1377 | } else { |
| 1378 | can_prune = FALSE; |
| 1379 | } |
| 1380 | } |
| 1381 | return can_prune; |
| 1382 | } |
| 1383 | |
| 1384 | |
| 1385 | void |
no test coverage detected