I am trying to parse a set of XML files. The XML file may have single flag tag or multiple flag tags:
<job> <flag exit="0">aaa</flag> </job>
OR
<job>
<flag exit="0">aaa</flag>
<flag exit="1">bbb</flag>
<flag exit="2">ccc</flag>
</job>
But determining this “flag” count has to be determined on the fly. What’s the best way to determine the flag count and print the values in it?
1 Answer