dimanche 31 juillet 2016

C++, RapidXML: function to get total of siblings nodes

for example:

<something>
   <x/>
   <x/>
   <y/>
   <z/>
</something>

It must return 2, I thought about using, for this example:

int Get_total_x(){
   int total=0;
   for(xml_node<> *x=root_node->first_node("x"); x; x=x->next_sibling()){
      total++;
   };
   return total;
};

Does RapidXML has a especific function for that?

Aucun commentaire:

Enregistrer un commentaire