Hi Magister
Try creating a DataSet in Visual Studio .NET using the design time
environment - you will see that if you create an element, then add a couple
of 'fields' to it, then the structure you get in the xsd looks a bit like
this:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Test" targetNamespace="http://tempuri.org/Test.xsd"
elementFormDefault="qualified"
attributeFormDefault="qualified" xmlns="http://tempuri.org/Test.xsd"
xmlns:mstns="http://tempuri.org/Test.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Test" msdata:IsDataSet="true">
<xs:complexType>
<xs:all>
<xs:element name="Test">
<xs:complexType>
<xs:sequence>
<xs:element name="Question" type="xs:string" minOccurs="0" />
<xs:element name="Answer" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
Then you can bind to the Question and Answer 'columns' by setting the
DataSource. Essentially the XML data needs to look more table like to work
the way that you want, with a root element representing the table, top level
element children of the root representing rows, and grand children of the
root representing columns.
HTH
Nigel
"magister" wrote:
Hello,
I have xml like this....
<test>
<question>sdfsa</question>
<section><question>43ga</question>
<question>asdf</question>
</test>
I make and xsd file with
<xs:all>
<xs:element....
<xs:element....
</xs:all>
I then bind the XML to a DataGrid...
DataGrid.DataSource = DataSet;
DataGrid.DataBind();
but I only get the questions, I notice there is a DataMember property
I can set to DataGrid.DataMember = "Section"; and I will get that one,
but essential I want a table with both elements in there...
Is there anyway to do this...?
Thank You