How to translate Excel in XML: 2 workflows

Anonim

Conversion from Microsoft Excel in XML

XML is a universal data format. It supports many programs, including from the DBMS sphere. Therefore, the conversion of information in XML is important from the point of view of interaction and data exchange between various applications. Excel is just among the programs that work with tables, and can even perform manipulations with databases. We will figure out how to convert Excel files to XML.

Conversion procedure

Conversion of data to XML format is not such a simple process, since in its course the special scheme (Schema.xml) must be created. However, to convert the information to the simplest file of this format, it is enough to have regular conservation tools in Excel at hand, and here to create a well-structured element will have to be thoroughly tinked with the compilation of the circuit and its connection to the document.

Method 1: Simple saving

In Excel, you can save data in XML format, simply using the "Save As ..." menu. True, there is no guarantee that then all programs will work correctly with the file that was created in this way. Yes, and not in all cases this method works.

  1. Run the Excel program. In order to open an element to be converted to go to the File tab. Next, click on the "Open" item.
  2. Go to the opening of the file in Microsoft Excel

  3. The file open window is launched. Go to the directory where the file that we need is contained. It must be in one of the formats of Excel - XLS or XLSX. Select it and click on the "Open" button located at the bottom of the window.
  4. Opening a file in Microsoft Excel

  5. As you can see, the file has been opened, and its data appeared on the current sheet. Again, go to the "File" tab.
  6. Go to the file tab in Microsoft Excel

  7. After that, go through the item "Save as ...".
  8. Go to saving a file in Microsoft Excel

  9. The save window opens. Go to the directory in which we wish to stored a converted file. However, you can leave the default directory, that is, the program suggested itself. In the same window, if a desire arises, you can change the file name. But the focus must be reversed on the "File Type" field. Recompay the list of click on this field.

    Transition to the selection of the file type in Microsoft Excel

    Among the saving options are looking for the name "Table XML 2003" or "XML data". We choose one of these items.

  10. Saving in XML format in Microsoft Excel

  11. After that, click on the "Save" button.

Saving a document in Microsoft Excel

Thus, the transformation of the file from Excel format in XML will be performed.

Method 2: Developer Tools

You can convert Excel format in XML using the developer tools on the Program tab. At the same time, if the user does everything correctly, then at the output it will receive, unlike the previous method, a full XML file that will correctly be perceived by third-party applications. But immediately need to say that not every newcomer may have enough knowledge and skills will immediately learn to convert data in this way.

  1. By default, the developer tool tab is disabled. Therefore, first of all, you need to activate it. Go to the "File" tab and click on the "Parameters" clause.
  2. Switch to parameters in Microsoft Excel

  3. In the opened parameters window, we move to the "Tape Setup" subsection. On the right side of the window, we set a tick near the "Developer" value. After that, we click on the "OK" button, located at the bottom of the window. The developer's tool tab is now enabled.
  4. Enable Developer Mode in Microsoft Excel

  5. Next, open the Excel table in the program in any convenient way.
  6. Table in Microsoft Excel

  7. On its basis, we have to create a scheme that is formed in any text editor. For these purposes, you can use the usual notebook Windows, but it is better to apply a specialized application for programming and working with NotePad ++ markup languages. Run this program. Create a scheme in it. On our example it will look, as shown in the bottom in the screenshot of the NotePad ++ window.

    Scheme in NotePad ++

    As we see, the opening and closing tag for the document as a whole serves "Data-Set" . In the same role for each line protrudes tag "Record" . For the scheme, it will be enough if we take only two rows of the table, and we will not translate it all manually in XML. The name of the opening and closing tag column can be arbitrary, but in this case, for convenience, we preferred to simply translate the Russian-speaking names of the speakers into English. After the data is made, simply save them through the text editor functionality anywhere on the hard disk in XML format called "Schema".

  8. Again, go to the Excel program with the already open table. We move to the "Developer" tab. On the tape in the "XML" tool block by clicking on the "Source" button. In the field that opens on the left side of the window we click on the "XML ..." cards button.
  9. Go to the selection of the source in Microsoft Excel

  10. In the window that opens, click on the button "Add ...".
  11. Transition to adding a scheme in Microsoft Excel

  12. A source selection window is started. Go to the directory of the location of the circuit drawn up earlier, select it and click on the "Open" button.
  13. Selection of the scheme in Microsoft Excel

  14. After the scheme elements appeared in the window, drag them using the cursor to the corresponding cells of the table column names.
  15. Modified Column Names in Microsoft Excel

  16. Right-click on the resulting table. In the context menu, we sequentially go through the items "XML" and "Export ...". After that, save the file in any directory.

Transition to export to Microsoft Excel

As you can see, there are two main ways to convert XLS and XLSX files to the Microsoft Excel XML format. The first one is extremely simple and lies in the elementary procedure for saving with the specified expansion through the "Save As ..." function. The simplicity and understandability of this option are undoubtedly the advantages. But he has one very serious drawback. The transformation is performed without taking into account certain standards, and therefore the file convertible by this method, third-party applications may simply not be recognized. The second option involves the compilation of the XML map. In contrast to the first method, the table, converted according to this scheme, will meet all XML quality standards. But, unfortunately, not every user will be able to quickly deal with the nuances of this procedure.

Read more