| 327 | } |
| 328 | |
| 329 | static xmlXPathObjectPtr |
| 330 | xml_get_all_paths (xmlDocPtr doc, xmlNodePtr node, const char *path) |
| 331 | { |
| 332 | xmlXPathContextPtr context; |
| 333 | xmlXPathObjectPtr result; |
| 334 | |
| 335 | context = xmlXPathNewContext(doc); |
| 336 | if (node) |
| 337 | xmlXPathSetContextNode(node, context); |
| 338 | |
| 339 | result = xmlXPathEvalExpression((const xmlChar *) path, context); |
| 340 | xmlXPathFreeContext(context); |
| 341 | if (result == NULL) |
| 342 | { |
| 343 | g_debug("xml: Error in xmlXPathEvalExpression"); |
| 344 | return NULL; |
| 345 | } |
| 346 | if(xmlXPathNodeSetIsEmpty(result->nodesetval)) |
| 347 | { |
| 348 | g_debug("xml: Node set is empty"); |
| 349 | xmlXPathFreeObject(result); |
| 350 | return NULL; |
| 351 | } |
| 352 | return result; |
| 353 | } |
| 354 | |
| 355 | static gboolean |
| 356 | chapter_list_import_xml (const gchar *file, signal_user_data_t *ud) |
no outgoing calls
no test coverage detected