How can I map the metadata to data. For example I only want LastName and Email from the xml file into the xls file. How can I select LastName and email from xml file and convert that into two column XLS file columns being Lastname and email. Thank you
XML Document
<root>
<metadata>
<item name="Last Name" type="xs:string" length="182"/>
<item name="First Name" type="xs:string" length="182"/>
<item name="Class Registration #" type="xs:decimal" precision="19"/>
<item name="Email" type="xs:string" length="422"/>
<item name="SacLink ID" type="xs:string" length="92"/>
<item name="Term Desc" type="xs:string" length="62"/>
<item name="Status Code" type="xs:string" length="6"/>
</metadata>
<data>
<row>
<value>XXX</value>
<value>xxxx</value>
<value>xxx</value>
<value>xxx</value>
<value>xxx</value>
<value>xx</value>
<value>xx</value>
</row>
<row>
<value>xxy</value>
<value>xx</value>
<value>xx</value>
<value>xx</value>
<value>xx</value>
<value>xx</value>
<value>xx</value>
</row>
</data>
</root>
This stylesheet:
Output:
You might use an XSL transform for this, outputting in CSV format which is loadable by Excel.
If you want to write a program using C# 4.0 and Office 2008/10, it's also easier than ever to leverage the interop capabilities - have a look at the C# Samples, in the office samples.