axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
axlList * axl_doc_get_pi_target_list ( axlDoc doc)

Allows to get a list which contains axlPI nodes, representing all process instruction that the document has.

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

However, this function will return first ocurrency 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 (axlDoc * doc)
2 {
3  int iterator;
4  axlPI * pi;
5  axlList * PIs;
6 
7  // get all PI target that the document has
8  PIs = axl_doc_get_pi_target_list (doc);
9  iterator = 0;
10 
11  while (iterator < axl_list_length (PIs)) {
12  // get next pi stored
13  pi = axl_list_get_nth (PIs, iterator);
14 
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));
19 
20  // update the iterator
21  iterator++;
22  }
23  return;
24 }
Parameters
docThe xml document (axlDoc) where the process instruction will be returned.
Returns
A reference to the list of processing instruction that the xml document (axlDoc) has.

References axl_return_val_if_fail.