cancel
Showing results for 
Search instead for 
Did you mean: 

Convert XML data into XLS

Former Member
0 Kudos

Hi,

Any body knows how to convert XML data into XLS. please let me know.

Regards,

Preetham

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Delimited files are definitely easiest if that works for you. Another option would be to convert your XML to Excel Spreadsheet XML. The schema for urn:schemas-microsoft-com:office:spreadsheet is huge, but you can download it from MS. I used XSLT to keep from having to deal with the schema. However, you could also create a slimmed down version of the xml schema supporting only what you need. It just depends on what you need to do. The following example will open directly into Excel (the file extension should still be .xml)


<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" 	
 	xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
 <Worksheet ss:Name="Sheet1">
  <Table>
   <Row>
    <Cell><Data ss:Type="String">Sheet1-A1</Data></Cell>
    <Cell><Data ss:Type="String">Sheet1-B1</Data></Cell>    
   </Row>
   <Row>
    <Cell><Data ss:Type="String">Sheet1-A2</Data></Cell>
    <Cell><Data ss:Type="String">Sheet1-B2</Data></Cell>    
   </Row>
  </Table>
 </Worksheet>
 <Worksheet ss:Name="Sheet2">
  <Table>
   <Row>
    <Cell><Data ss:Type="String">Sheet2-A1</Data></Cell>
    <Cell><Data ss:Type="String">Sheet2-B1</Data></Cell>    
   </Row>
   <Row>
    <Cell><Data ss:Type="String">Sheet2-A2</Data></Cell>
    <Cell><Data ss:Type="String">Sheet2-B2</Data></Cell>    
   </Row>
  </Table>
 </Worksheet>
</Workbook>

If you add <?mso-application progid="Excel.Sheet"?> to the XML, windows will know to open it using Excel when you double click it. If you donu2019t use this it still works, but you will need to use u201COpen With -> Excelu201D instead. Just save any current XLS file as u201CSpreadsheet XMLu201D (not Data XML) to see an example of a fully formatted file. It may be large, but the simple example above still works without all the formatting. Of course, some things are not supported in this format (shapes, objects, charts, etc), but thatu2019s expected.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

If your question is about how to do this conversion in XI

XSLT mapping is the answer.

Thanks

Gaurav

Former Member
0 Kudos

Hi,

Download Altova XML Spy.. you can get it for free for 30 days. that can do that.

Thanks

-Kulwant

VijayKonam
Active Contributor
0 Kudos

if it is your requirement, and you are expected to generate and xls file, then you can simply go with "," as field separator in the file generated and give the file name as .csv or .xls. When some one double clicks on it, it will be automatically opened with Excel. If they want they can save it as an actual xls.

VJ

Former Member
0 Kudos

hi preetam,

if i understood you correclty, just google it you will find many tools to convert XML to XLS.

Regards,

Sukarna.ch