471,065 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,065 software developers and data experts.

XMLDataDocument <-> DataSet -- out of sequence

I am trying to read data from MS SQL Server and turn it into an XML message
to send to a remote server, as follows.

sfSchemaFileDiag.FilterIndex = 2

If sfSchemaFileDiag.ShowDialog = DialogResult.OK Then

DataSet1.WriteXml(sfSchemaFileDiag.FileName)

End If

The resulting XML file is out of sequence. It does not match the schema
file I loaded. It always puts complex types last. When I dump the schema
using WriteXMLSchema, the schema shows up right.

What am I doing wrong?

Thanks.

Daniel Wilson
Senior Software Solutions Developer
Embtrak Team, DV Brown Company
864-292-5888
Aug 24 '06 #1
3 1765
"Daniel Wilson" <d.******@EmbTrak.comwrote in message
news:uW**************@TK2MSFTNGP03.phx.gbl...
>I am trying to read data from MS SQL Server and turn it into an XML message
to send to a remote server, as follows.

sfSchemaFileDiag.FilterIndex = 2

If sfSchemaFileDiag.ShowDialog = DialogResult.OK Then

DataSet1.WriteXml(sfSchemaFileDiag.FileName)

End If

The resulting XML file is out of sequence. It does not match the schema
file I loaded. It always puts complex types last. When I dump the schema
using WriteXMLSchema, the schema shows up right.

What am I doing wrong?
What do you mean that it's out of sequence? Does it validate against the
schema you loaded?

John
Aug 24 '06 #2
No, it doesn't validate.

From Schema ...
<xs:element name="SalesOrderAddRq" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="SalesOrderAdd" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerRef" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="FullName" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TxnDate" type="xs:string"
minOccurs="0" />
<xs:element name="BillAddress" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Addr1" type="xs:string"
minOccurs="0" />
<xs:element name="Addr2" type="xs:string"
minOccurs="0" />
<xs:element name="City" type="xs:string"
minOccurs="0" />
<xs:element name="State" type="xs:string"
minOccurs="0" />
<xs:element name="PostalCode"
type="xs:string" minOccurs="0" />
<xs:element name="Country" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ShipAddress" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Addr1" type="xs:string"
minOccurs="0" />
<xs:element name="Addr2" type="xs:string"
minOccurs="0" />
<xs:element name="City" type="xs:string"
minOccurs="0" />
<xs:element name="State" type="xs:string"
minOccurs="0" />
<xs:element name="PostalCode"
type="xs:string" minOccurs="0" />
<xs:element name="Country" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PONumber" type="xs:string"
minOccurs="0" />
From generated XML ...
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderAddRq requestID="0">
<SalesOrderAdd>
<TxnDate>2007-03-20</TxnDate>
<PONumber>
</PONumber>
<DueDate>2006-03-27</DueDate>
<CustomerRef>
<FullName>Bentley Hard Drives, Inc.</FullName>
</CustomerRef>
<BillAddress>
<Addr1>P.O. BOX 3169</Addr1>
<Addr2>
</Addr2>
<City>ATLANTA</City>
<State>GA</State>
<PostalCode>30309</PostalCode>
<Country>USA</Country>
</BillAddress>
<ShipAddress>
<Addr1>P.O. BOX 3169</Addr1>
<Addr2>
</Addr2>
<City>ATLANTA</City>
<State>GA</State>
<PostalCode>30309</PostalCode>
<Country>USA</Country>
</ShipAddress>

In the XML, the PONumber & TxnDate precede the CustomerRef and addresses.
The CustomerRef is supposed to come first. The PONumber is supposed to
follow the addresses.

So the thing doesn't validate.

Thanks for your help!

dwilson
"John Saunders" <john.saunders at trizetto.comwrote in message
news:eA**************@TK2MSFTNGP03.phx.gbl...
"Daniel Wilson" <d.******@EmbTrak.comwrote in message
news:uW**************@TK2MSFTNGP03.phx.gbl...
I am trying to read data from MS SQL Server and turn it into an XML
message
to send to a remote server, as follows.

sfSchemaFileDiag.FilterIndex = 2

If sfSchemaFileDiag.ShowDialog = DialogResult.OK Then

DataSet1.WriteXml(sfSchemaFileDiag.FileName)

End If

The resulting XML file is out of sequence. It does not match the schema
file I loaded. It always puts complex types last. When I dump the
schema
using WriteXMLSchema, the schema shows up right.

What am I doing wrong?

What do you mean that it's out of sequence? Does it validate against the
schema you loaded?

John


Aug 25 '06 #3
+1

Sep 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Antonio Maciel | last post: by
2 posts views Thread by Vish | last post: by
reply views Thread by Vish | last post: by
1 post views Thread by Petr Felzmann | last post: by
reply views Thread by Reshma Prabhu | last post: by
4 posts views Thread by Adrian Meyer | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.