Converting Excel to XML
I have hierchical data stored in a spreadsheet that I am converting into an xml using a Groovy script.
Col A Col B
A A1
A A2
A A2
B B1
B B1
B B2
This needs to be as foll开发者_运维百科ows in XML format:
<A>
<A1></A1>
<A2></A2>
</A>
<B>
<B1></B1>
<B2></B2>
</B>
I have managed to do read it off the xls and write it to xml.I am having trouble associating A1 and A2 with a single element A My output currently looks like
<A>
<A1></A1>
</A>
<A>
<A2></A2>
</A>
<B>
<B1></B1>
</B>
<B>
<B2></B2>
What is a good programmatic way to read the excel?
Turned out to be fairly simple using a hash in groovy
精彩评论