I have this XML file:
<cjl>
<job>
<plan on="1">aa</plan>
<exec>d.java</exec>
</job>
</cjl>
The job
tag may be repeating and also the plan tag
also may be repeating.
<cjl>
<job>
<plan on="2">aa</plan>
<exec>e.java</exec>
</job>
<job>
<exec>f.java</exec>
<plan on="1">bb</plan>
<plan on="3">cc</plan>
</job>
</cjl>
In spite of whether it's single or array, I want to print the values as CSV. In the first case, I want to print:
d.java, aa, 1
The second XML file one should print the value in two lines as:
e.java, aa, 2
f.java, bb, cc, 1, 3
What is the best way to do that?
Also, since data are stored in XML files, how do I read them?