<div>Hello,</div> <div>I have a XSD that looks like this:</div> <div> </div> <div><xs:schema id="FlowInfo" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified"
elementFormDefault="qualified">
<xs:element name="FlowInfoRoot">
<xs:complexType>
<xs:sequence>
<xs:element name="FlowInfoData">
<xs:complexType>
<xs:sequence>
<xs:element name="flowState" type="xs:string" minOccurs="0" />
<xs:element name="traceRoot">
<xs:complexType>
<xs:sequence>
<xs:element name="trace">
<xs:complexType>
<xs:sequence>
<xs:element name="traceComment" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema></div> <div> </div> <div> </div> <div>If I want to fill this, I use the following c# code:</div> <div>dsFlowInfo.FlowInfoData.Rows.Add(dsFlowInfo.FlowInfoData.NewFlowInfoDataRow());</div> <div>dsFlowInfo.FlowInfoData[0].flowState = flowstate;</div>
<div> </div> <div>This works without any problem.</div> <div>However,</div> <div>If I want to fill multiple "trace" rows, how do I do that ? </div> <div>I want to add a row of type "trace" to "traceRoot"
</div> <div>dsFlowInfo.FlowInfoData.Rows.Add(dsFlowInfo.FlowInfoData.NewFlowInfoDataRow());</div> <div>dsFlowInfo.traceRoot.Rows.Add(dsFlowInfo.traceRoot.NewtraceRootDataRow());</div> <div>dsFlowInfo.trace.Rows.Add(dsFlowInfo.trace.NewtraceDataRow());</div>
<div> </div> <div>//filling of the elements is not included</div> <div> </div> <div>This results in that <traceRoot /> is empty and that <trace> is filled correctly but is placed on the FlowInfoData level. What must I do to create a new row of type "trace"
on the level of "traceRoot" ?</div> <div> </div> <div>Regards,</div> <div>Nicolas</div>
Vertigo-IT
Member
55 Points
11 Posts
xml xsd filling question
Nov 04, 2006 01:07 PM|LINK
<xs:element name="FlowInfoRoot">
<xs:complexType>
<xs:sequence>
<xs:element name="FlowInfoData">
<xs:complexType>
<xs:sequence>
<xs:element name="flowState" type="xs:string" minOccurs="0" />
<xs:element name="traceRoot">
<xs:complexType>
<xs:sequence>
<xs:element name="trace">
<xs:complexType>
<xs:sequence>
<xs:element name="traceComment" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema></div> <div> </div> <div> </div> <div>If I want to fill this, I use the following c# code:</div> <div>dsFlowInfo.FlowInfoData.Rows.Add(dsFlowInfo.FlowInfoData.NewFlowInfoDataRow());</div> <div>dsFlowInfo.FlowInfoData[0].flowState = flowstate;</div> <div> </div> <div>This works without any problem.</div> <div>However,</div> <div>If I want to fill multiple "trace" rows, how do I do that ? </div> <div>I want to add a row of type "trace" to "traceRoot"
</div> <div>dsFlowInfo.FlowInfoData.Rows.Add(dsFlowInfo.FlowInfoData.NewFlowInfoDataRow());</div> <div>dsFlowInfo.traceRoot.Rows.Add(dsFlowInfo.traceRoot.NewtraceRootDataRow());</div> <div>dsFlowInfo.trace.Rows.Add(dsFlowInfo.trace.NewtraceDataRow());</div> <div> </div> <div>//filling of the elements is not included</div> <div> </div> <div>This results in that <traceRoot /> is empty and that <trace> is filled correctly but is placed on the FlowInfoData level. What must I do to create a new row of type "trace" on the level of "traceRoot" ?</div> <div> </div> <div>Regards,</div> <div>Nicolas</div>
My ASP.NET 2.0 Ajax website:
http://www.vertigoit.be
My blog: http://vertigoit.blogspot.com