This article was previously published under Q325696
This article has been archived. It is offered "as is" and will no longer be updated.
Valid XML documents that contain multidimensional data cannot be displayed in the Data view of the Microsoft Visual Studio .NET XML Designer.
Note An example of multidimensional data is a single table that participates in more than one parent-child relationship.
When you try to switch to Data view, you receive the following error message on the Data tab of the XML Designer:
Although this XML document is well formed, it contains structure that Data view cannot display. The same table (Table name) cannot be the child table in two nested relations.
When the Visual Studio .NET XML Designer tries to generate the Data view of an XML document, the XML Designer applies the Microsoft ADO.NET schema inference rules to determine the schema information for the source XML. The ADO.NET schema inference rules in the original release version of the Microsoft .NET Framework do not permit a single table to be a child table in more than one DataRelation object.
According to ADO.NET schema inference rules, elements that have child elements are inferred as tables. In the example in the "Steps to reproduce the behavior" section, the Order element, the Item element, and the Inventory element all have child elements. Therefore, all these elements are inferred as individual DataTable objects.
If elements are inferred as tables, and these tables are nested in other elements that are also inferred as tables, a nested DataRelation is created between the two tables. Therefore, the Item DataTable is also inferred as participating in two parent-child relationships, the Order-Item relationship and the Inventory-Item relationship.
This behavior causes the XML data to be not valid according to the ADO.NET schema inference rules. Therefore, the XML Designer cannot display the data.
This behavior is by design.
Steps to reproduce the behavior
In a text editor such as Notepad, paste the following XML data, and then save the file as C:\OrdersInv.xml.
Microsoft Visual Studio .NET 2003 Enterprise Architect, Microsoft Visual Studio .NET 2003 Enterprise Developer, Microsoft Visual Studio .NET 2003 Academic Edition, Microsoft Visual Studio .NET 2002 Professional Edition, Microsoft Visual Studio .NET 2002 Enterprise Architect, Microsoft Visual Studio .NET 2002 Enterprise Developer, Microsoft Visual Studio .NET 2002 Academic Edition