473,239 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 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 1909
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Antonio Maciel | last post by:
Hi. Some MS articles states that the XmlDataDocument can be used for XML databinding. Is this object a replacement for XML Data Islands? Thanks, Antonio Maciel
3
by: Henrik K | last post by:
Selecting element nodes from a xmlDataDocument using the childNodes collection or by using selectSingleNode and then reading innerXml or outerXml leaks cpu-resources. A trivial example showing...
1
by: Jim Bancroft | last post by:
Hi, I'm porting a VB 6 app to .Net, and wanted to use an XMLDataDocument to store information that had previously been kept in XML Recordsets. Unfortunately, I'm not too familiar yet with...
2
by: Vish | last post by:
Hi, I have a set of nested object classes that now i have to serialize/deserialize to make webservice calls. I was thinking wouldn't it be better to use an XML Data document instead of using...
0
by: Vish | last post by:
I am trying to use xmldatadocument to load an xml file.The xml has the data as attributes, the datadocument is able to successfully parse the document into the tables and shows the right column...
1
by: Petr Felzmann | last post by:
Hi, why the duration of call the CloneNode(true) is steadily increasing? First call is 0.004s and 100th is 0.16s! XML file is 5kB only, no disk swap. XmlDataDocument xml = new...
1
by: jean | last post by:
I am creating an xmldatadocument from an acess database with visual basic. Here is the header code I am using: Dim xmldcl As XmlDeclaration = myDoc.CreateXmlDeclaration("1.0", "UTF-8", "yes")...
0
by: Reshma Prabhu | last post by:
Hello, I am using XmlDataDocument's LoadXml( ) function to load a particular xml string. This xml string contains a reference to a particular DTD. Though LoadXml function does not perform DTD or...
4
by: Adrian Meyer | last post by:
Hi, On the server I code the following web service: ))] public XmlDataDocument GetTypedXmlDataDocument() { sqlDataAdapter1.Fill(typedDataSet1); XmlDataDocument dataDoc
1
by: Alcibiades | last post by:
I have a piece of code to read a xml file from the web and put it into a variable in SSIS, but i don't know how to get it if it's username and password protected: URL =...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.