axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
axlList * axl_node_get_pi_target_list ( axlNode node)

Allows to get a list which contains axlPI nodes, representing all process instruction that the axlNode (xml document node) has.

While using PI, you can use the following functions to get PI information:

However, this function will return first ocurrence for PI found inside the xml document. If you don't use repeated PI elements, you won't find problems, but, if you need to iterate ever all PI found or you are using repeated PI, you can use this function as follows to get current pi elements:

1 void show_all_pi (axlNode * node)
2 {
3  int iterator;
4  axlPI * pi;
5  axlList * PIs;
7  // get all PI target that the node has
8  PIs = axl_node_get_pi_target_list (node);
9  iterator = 0;
11  while (iterator < axl_list_length (PIs)) {
12  // get next pi stored
13  pi = axl_list_get_nth (PIs, iterator);
15  // do some stuff
16  printf ("PI found target name=%s, content=%s\n",
17  axl_pi_get_name (pi),
18  axl_pi_get_content (pi));
20  // update the iterator
21  iterator++;
22  }
24  // once finished, free the list
25  axl_list_free (PIs);
26  return;
27 }
nodeThe xml node (axlNode) where the process instruction will be returned.
A reference to the list of processing instruction that the xml node (axlNode) has. The returned list, if defined, must be deallocated.

References axl_item_get_type(), axl_list_add(), axl_list_always_return_1(), axl_list_new(), axl_pi_free(), axl_return_val_if_fail, and ITEM_PI.