locked
xml - excel RRS feed

  • Question

  • Hi,
    I have been given an .xml file to investigate how it produces data.
    Basically there is a file called testData.xml
    when this file is double clicked, it opens up in excel with data.
    If you right click and open in excel then a properly formatted excel workbook with two named sheets appear which have both got formatted data in them.

    I have pasted the first few lines of the xml file for you to see.

    Could you let me know how this is possible and where is the data coming from?

    <?xml version="1.0" ?>
    - <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>Ursula Bitterlin</Author>
      <LastAuthor>874496</LastAuthor>
      <LastPrinted>2006-07-05T15:45:06Z</LastPrinted>
      <Created>2005-01-12T14:14:33Z</Created>
      <LastSaved>2006-07-10T11:15:56Z</LastSaved>
      <Company>Engineering</Company>
      <Version>10.6735</Version>
      </DocumentProperties>
    - <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
      <DownloadComponents />
      <LocationOfComponents HRef="/" />
      </OfficeDocumentSettings>
    - <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
      <WindowHeight>5325</WindowHeight>
      <WindowWidth>11820</WindowWidth>
      <WindowTopX>120</WindowTopX>
      <WindowTopY>60</WindowTopY>
      <ActiveSheet>1</ActiveSheet>
      <ProtectStructure>False</ProtectStructure>
      <ProtectWindows>False</ProtectWindows>
      </ExcelWorkbook>
    - <Styles>
    - <Style ss:ID="Default" ss:Name="Normal">
      <Alignment ss:Vertical="Bottom" />
      <Borders />
      <Font />
      <Interior />
      <NumberFormat />
      <Protection />
      </Style>
    - <Style ss:ID="s16" ss:Name="Comma">
      <NumberFormat ss:Format="_ * #,##0.00_ ;_ * \-#,##0.00_ ;_ * "-"??_ ;_ @_" />
      </Style>

     

    Friday, August 25, 2006 1:25 PM

Answers

  • Office 2003 has XML support so for instance Word in Office 2003 besides the .doc format can load and save its documents in WordML XML format and Excel to can load from XML and save to XML. What you have shown seems to be an excerpt of an XML document Excel 2003 can save to or load from.

    What do you want to know exactly, which XML element in your XML snippet defines the data you see in a cell in the Excel sheet? I think your snippet does not show the data cells.

    Friday, August 25, 2006 2:09 PM

All replies

  • Office 2003 has XML support so for instance Word in Office 2003 besides the .doc format can load and save its documents in WordML XML format and Excel to can load from XML and save to XML. What you have shown seems to be an excerpt of an XML document Excel 2003 can save to or load from.

    What do you want to know exactly, which XML element in your XML snippet defines the data you see in a cell in the Excel sheet? I think your snippet does not show the data cells.

    Friday, August 25, 2006 2:09 PM
  • If i understand this correctly, the excel report is produced and populated based on the xsl in .xml file

    There are lines in the xml file such as the following with curly brackets around the fiel names.

    - <Cell ss:StyleID="s35">
      <Data ss:Type="String">{EMPLOYEEID}</Data>
      <NamedCell ss:Name="Print_Area" />
      </Cell>
    Friday, August 25, 2006 2:13 PM
  • There is no xsl in this xml.

    Excel can read and write such files dirrectly without any format translation (xsl). It recognizes its files by name and namespace of the root element.

    Saturday, August 26, 2006 7:21 PM
  • I have a question, if I want write an xml file by hand and open it in Excel, what is the structure of the xml file? Is there a fixed structure for it? How can I get it?

    Thanks

    Tuesday, September 12, 2006 1:48 AM
  • Look on the Office XML side, there you will find a download link for the schemas that define the different XML (e.g. WordML, Excel XML) formats Office 2003 uses.

    But these schemas are complex, it might be easier to simply automate Excel to have it create a spreadsheet and save it in XML format.

    Tuesday, September 12, 2006 12:45 PM
  • Thank you for your help. Finally I choose the way of creating an Xml worksheet by saving a .xls file as a .xml file, it seems working. The document seems too complex to me
    Monday, November 13, 2006 12:20 AM