Approaches to Using XML Maps

The limitations that come with XML maps imply a set of approaches when using them with XML. You can’t just assume that you will be able to successfully import, edit, and export arbitrary XML data using Excel. XML maps are best suited for XML structured a certain way.

For example, the preceding SimpleOrder.xml sample requires some changes if you want to be able to view and edit orders via XML maps. Specifically:

  • Each order should be stored in a separate file. XML maps can’t export lists of lists, so including multiple orders, each with multiple line items, prevents you from exporting the orders.

  • Line items must be presented as a separate list. Simply importing an order as a single list results in denormalized data that can’t be exported from the list.

These changes and other recommendations are explained in the following sections.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.