How to convert xsd file to xls

I have an XSD file, and I need to convert it to an MS Excel file. XSD is below.

<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="shiporder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson" type="xs:string"/> <xs:element name="shipto"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="address" type="xs:string"/> <xs:element name="city" type="xs:string"/> <xs:element name="country" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="item" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="note" type="xs:string" minOccurs="0"/> <xs:element name="quantity" type="xs:positiveInteger"/> <xs:element name="price" type="xs:decimal"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="orderid" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:schema> 

Help me, I really don’t know how and where to start.

+7
source share
4 answers

This answer is the same for you, as well as @Alex, @Michael and forty-two. I illustrate this with Excel 2010, so if you are using a different version, I will leave it for you to make the necessary adjustments.

First, make sure that the tab is displayed on the developer's tab (tab "File", "Options").

Excel 2010 options for Developer tab

Now you need to create an XML source from your XSD: click on the "Developer" tab; in the XML group, switch the "Source" button to display the "Xml Source" taskbar; then click the "XML Maps" button.

Excel showing key UI elements for creating an XML map

Click the "Add" button at the invitation; point to the XSD file; then click “OK” to return to the main screen.

Excel showing XSD loaded in an XML map

Then you can drag your shipOrder into a cell on the sheet to bind the generated mapped table.

Excel showing mapped XSD

Then you can use “Import” to get the XML data in the spreadsheet and “Export” to get it. There are a few more things to watch out for; read this article on the Microsoft website ; Pay particular attention to problems with exporting XML data (XML error maps in my book are not exported). This is due to 1 many capacities between shiporder and item. You can try to deal with this using mapped ranges - I will leave it all up to you. It would be best to read the online help for the XML Developers section ...

+26
source

Go to MS Excel File Open . Select the xsd file.

You will be prompted to open the file. You can select the option “Like an XML table”. Save the file in excel format.

+2
source

You can save the file as an XML file, and then open it in Excel and open it as a "book to read" when prompted. However, it will not be in a good format, but at least all the data (along with the XML paths in the form of columns) will be there.

Then you can edit the data as needed. For something else, some processing is required.

0
source

Select all the XSD text in a text editor, copy it to the clipboard, click a cell in the Excel spreadsheet, and paste. Your XSD data will now be in your table.

It will not be in a very useful format, but you did not tell us that you want the table to look like this, and it’s hard for me to imagine a format that would be useful.

-one
source

All Articles