Microsoft KB Archive/325696

= You receive an error message when you view multidimensional XML data in the Visual Studio .NET XML Designer =

Article ID: 325696

Article Last Modified on 3/9/2006

-

APPLIES TO


 * 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

-



This article was previously published under Q325696





SYMPTOMS
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.



CAUSE
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 &quot;Steps to reproduce the behavior&quot; 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.



STATUS
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.     1 5          <Inventory>  1</id> 100        </Item> </Inventory> </OrdersInventoryData> </li> <li>In Visual Studio .NET, open the C:\OrdersInv.xml file. The XML file opens in the XML Designer.</li> <li>Click the Data tab to view the XML data in Grid format. Notice that the XML Designer is not available, and you receive the error message that is mentioned in the &quot;Symptoms&quot; section.</li></ol>

<div class="references_section">