Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel with xml -> source and guide for tags and attributes

Tags:

xml

excel

openxml

Excel can directly open .xml files and render them properly.

An example can be found here: http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats#Excel_XML_Spreadsheet_example

I am trying to find a source on tags and attributes that are used and on general structure, but I could not find any.

I am very unfamiliar with all this. I do not even know where to start from.

Any help is appreciated. Where do I find documentation on what tags are supported?

like image 366
Koray Tugay Avatar asked Nov 28 '13 13:11

Koray Tugay


People also ask

How do you create an XML from an Excel File?

Click File > Save As, and select the location where you want to save the file. , point to the arrow next to Save As, and then click Other Formats. In the File name box, type a name for the XML data file. In the Save as type list, click XML Data, and click Save.


2 Answers

The topic of using XML in Excel (and Office in general) is quite wide. I will then focus on your specific question (a source on tags and attributes that are used and on general structure) and additional (mostly hands-on) sources that I guess you need to get going.

Given that you mention that you are unfamiliar, prior to having a reference for tags, etc., you would probably like to read some kind of user's guide on what you can achieve with XML and Excel. You would probably want to do more than simply opening XML files as the example you linked given in Wikipedia. You can make XML and Excel "interact". A good starter for this is an Overview of XML in Excel.

As for your request for sources:

  • A good reference for tags is given in the external link of Wikipedia, which is an XML Spreadsheet Reference. Note also the hierarchy of tags.
  • To learn about the structure:
    • See this starter, and this one.
    • Wikipedia also provides info, including references to official info by ECMA.
    • Information by officeopenxml.com is very helpful as well.

Extra notes:

  • When developing XML-Excel, remember to use the XML Source task pane (Developer -> XML -> Source).
  • Note the Limitations and differences (of Microsoft Office XML formats) with Office Open XML (Office Open XML started with Office 2007).
  • Interestingly, you can take an Excel file (say, myfile.xlsx), change it to myfile.zip or myfile.xlsx.zip, and extract/explore its contents. Xlsx files are just zip containers. Doing this may be instructive (and laborious).

Other useful links:

  • Office Open XML Essentials.
  • Introducing the Office (2007) Open XML File Formats.
  • White paper from the beginnings (note that http://www.openxmlformats.org redirects to http://www.microsoft.com).
  • Software supporting Office Open XML (spreadsheets and others as well). There are many open source, and they include Spreadsheet software, Viewers, filters and converters, Programmatic support, etc.

This is just a summary of pointers. Hope it helps.

like image 174
sancho.s ReinstateMonicaCellio Avatar answered Oct 05 '22 00:10

sancho.s ReinstateMonicaCellio


To work with Excel spreadsheets, or any other Microsoft Office documents for that matter, I suggest that you investigate the newer Office Open XML (OOXML) rather than the earlier Microsoft Office XML format that you cite.

OOXML offers advantages over the earlier Microsoft Office XML formats:

  • OOXML reigns in many of the versioning dependencies that plagued earlier Office XML formats.
  • OOXML is defined by an international standard (ECMA-376).
  • OOXML uses a more sensible packaging system (OPC); the earlier format embeds binary in a large, monolithic XML file.
  • OOXML can represent full document fidelity, including VBA macros, graphic objects, outlines, custom views, etc.

Standard ECMA-376 Office Open XML File Formats defines the vocabularies for OOXML.

Non-Microsoft OOXML Resources:

Others have provided official Microsoft documentation. In addition to the ECMA and ISO/IEC standard organizations links I provided above, here are some helpful resources beyond what Microsoft provides:

  • Eric White has an extensive collection of tutorials, screen-casts, and examples on OOXML. Eric was the developer relations evangelist at Microsoft during OOXML standardization and development period. His work from the period is a must read for developers wishing to work with OOXML.
  • How much has Open XML caught on?
  • open xml excel read cell value
  • Creating Excel document with OpenXml sdk 2.0
  • Simple OOXML is great for creating and modifying OOXML. It is open source.

You mentioned in your question wanting to find a "source on tags and attributes". You can download the reference XSDs (as well as non-normative RelaxNG schemas) here. There's also a Office Open XML fundamentals document that has plenty of examples and explanations.

like image 38
kjhughes Avatar answered Oct 04 '22 23:10

kjhughes