Jump to content

xml to excel


ninjoe8

Recommended Posts

In Excel, select:Data>XML>Import...and select all of the XMLs you want to import.If you want to make such thing automatically, you need to use a PHP script of some sort. I have no idea how this script will look though.There is another way too, but it's actually harder then to look for a pure PHP solution. You can combine all of your XMLs into one XML that will use the syntax that Excel understands. If that XML is opened in IE, it will result in Excel being opened in a frame. However, such XML looks pretty complex. Here's the minimal amount of code it must contain:

<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">  <Author>Your username</Author>  <LastAuthor>Your username</LastAuthor>  <Created>2006-10-06T20:17:55Z</Created>  <Company>Your company</Company>  <Version>11.8036</Version> </DocumentProperties> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">  <WindowHeight>12915</WindowHeight>  <WindowWidth>15180</WindowWidth>  <WindowTopX>480</WindowTopX>  <WindowTopY>30</WindowTopY>  <ProtectStructure>False</ProtectStructure>  <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles>  <Style ss:ID="Default" ss:Name="Normal">   <Alignment ss:Vertical="Bottom"/>   <Borders/>   <Font x:CharSet="204"/>   <Interior/>   <NumberFormat/>   <Protection/>  </Style> </Styles> <Worksheet ss:Name="Sheet1">  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">   <Selected/>   <Panes>    <Pane>     <Number>3</Number>     <ActiveRow>39</ActiveRow>     <ActiveCol>6</ActiveCol>    </Pane>   </Panes>   <ProtectObjects>False</ProtectObjects>   <ProtectScenarios>False</ProtectScenarios>  </WorksheetOptions> </Worksheet></Workbook>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...