

If the Multiple Roots dialog box appears, choose one of the root nodes defined in the XML schema file.įor an XML data file, Excel will try to infer the XML schema from the XML data, and then creates an XML Map. In the Look in list, click the drive, folder, or Internet location that contains the file you want to open.įor an XML schema file, XML will create an XML Map based on the XML schema. In the XML Source task pane, click XML Maps, and then click Add. If you don't see the Developer tab, see Show the Developer tab. The schema can be copied from an XML schema file (.xsd), or Excel can try to infer one from an XML data file (.xml). You create an XML Map by adding an XML schema to a workbook. Press Ctrl+N in Notepad and repeat step 1-3 to create a file for the second sample text. Press Ctrl+S to save the file with the file name and extension of the sample data you copied. Start Notepad, and press Ctrl+V to paste the sample text. Select the sample text of the file you want to copy, and press Ctrl+C. Here’s how you can save this sample data to files on your computer: The following sample data has basic XML elements and structures you can use to test XML mapping if you don't have XML files or text files to create the XML files. Excel doesn't support the simple content of the complex type but does support the child tags and attributes defined in that complex type. Mixed content This content is declared by using mixed="true" on a complex type definition. An element indicates it's a member of another element's substitution group through the attribute. Substitution groups These groups allow an element to be swapped wherever another element is referenced. Abstract elements depend on other elements being substituted for the abstract element. Excel doesn't support recursive structures more than one level deep.Ībstract elements These elements are meant to be declared in the schema, but never used as elements. Recursive structures A common example of a recursive structure is a hierarchy of employees and managers in which the same XML elements are nested several levels. This element allows you to include attributes that aren't declared by the schema.

This element allows you to include elements that aren't declared by the schema. The following XML schema element constructs can't be imported into Excel: There are several types of XML schema element constructs Excel doesn't support. Import the XML file you exported from Access. See Map XML elements for more information. If the Multiple Roots dialog box appears, make sure you choose dataroot so you can create an XML table.Ĭreate an XML table by mapping the dataroot element. In the Export - XML File dialog box, specify the file name and format, and click OK.Ĭreate an XML Map based on the XML schema file you exported from Access. In the Open dialog box, select and open the database in which you want to create a new table.Ĭlick External Data > Text File, and follow the instructions for each step, making sure that you link the table to the text file.Īccess creates the new table and displays it in the Navigation Pane.Įxport the data from the linked table to an XML data file and an XML schema file.Ĭlick External Data > XML File (in the Export group). Import the text file you want to convert and link it to a new table. You can then use both Access and Excel to convert that text file to the XML files you need. If you don’t have the necessary XML files, you can create them by saving the data you want to use as a text file. For example, you might have a line-of-business application that exports data into these XML file formats, a commercial web site or web service that supplies these XML files, or a custom application developed by your IT department that automatically creates these XML files.

If another database or application created an XML schema or XML data file, you might already have them available. Locate or create XML schema and XML data files

Tip: You'll find more information about using XML with Excel in this overview of XML in Excel.
