473,804 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

sfSchemaFileDia g.FilterIndex = 2

If sfSchemaFileDia g.ShowDialog = DialogResult.OK Then

DataSet1.WriteX ml(sfSchemaFile Diag.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 1948
"Daniel Wilson" <d.******@EmbTr ak.comwrote in message
news:uW******** ******@TK2MSFTN GP03.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.

sfSchemaFileDia g.FilterIndex = 2

If sfSchemaFileDia g.ShowDialog = DialogResult.OK Then

DataSet1.WriteX ml(sfSchemaFile Diag.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="SalesOrde rAddRq" minOccurs="0" maxOccurs="unbo unded">
<xs:complexType >
<xs:sequence>
<xs:element name="SalesOrde rAdd" minOccurs="0"
maxOccurs="unbo unded">
<xs:complexType >
<xs:sequence>
<xs:element name="CustomerR ef" minOccurs="0"
maxOccurs="unbo unded">
<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="BillAddre ss" minOccurs="0"
maxOccurs="unbo unded">
<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="PostalCod e"
type="xs:string " minOccurs="0" />
<xs:element name="Country" type="xs:string "
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ShipAddre ss" minOccurs="0"
maxOccurs="unbo unded">
<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="PostalCod e"
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="stopOn Error">
<SalesOrderAddR q requestID="0">
<SalesOrderAd d>
<TxnDate>2007-03-20</TxnDate>
<PONumber>
</PONumber>
<DueDate>2006-03-27</DueDate>
<CustomerRef>
<FullName>Bentl ey Hard Drives, Inc.</FullName>
</CustomerRef>
<BillAddress>
<Addr1>P.O. BOX 3169</Addr1>
<Addr2>
</Addr2>
<City>ATLANTA </City>
<State>GA</State>
<PostalCode>303 09</PostalCode>
<Country>USA</Country>
</BillAddress>
<ShipAddress>
<Addr1>P.O. BOX 3169</Addr1>
<Addr2>
</Addr2>
<City>ATLANTA </City>
<State>GA</State>
<PostalCode>303 09</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.saunder s at trizetto.comwro te in message
news:eA******** ******@TK2MSFTN GP03.phx.gbl...
"Daniel Wilson" <d.******@EmbTr ak.comwrote in message
news:uW******** ******@TK2MSFTN GP03.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.

sfSchemaFileDia g.FilterIndex = 2

If sfSchemaFileDia g.ShowDialog = DialogResult.OK Then

DataSet1.WriteX ml(sfSchemaFile Diag.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
1558
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
6574
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 this behaviour is included below. Running this example increases the cpu-load gradually and reaches 100% within a minute or two. The problem exists with innerXml as well as outerXml operations. Using a xmlDocument instead of a xmlDataDocument...
1
2092
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 .Net's XML Namespace and was wondering if someone could help with something....in the VB 6 application, we would append two extra nodes to the XMLRecordset-- an error message, and error number. Then, when it came time to reconstruct the recordset...
2
1641
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 classes so i can import/export xml with ease and also i can update my schema without compiling the code. What advantages/disadvantages do you guys see in taking this approach. Any kind of suggestions are welcome. Thanks!
0
1392
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 count but does not add any rows. I tried validating the schema everything is fine but no data is returned . I have attached the sample xml file and schema. Any help is appreciated . Thanks! <SiebelMessage CallingApp="COM" ErrorMsg="" ErrorCode=""...
1
1264
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 XmlDataDocument(); xml.Load(@"C:\foo.xml"); for(int i = 0; i < 100; i++) { XmlNode node = xml.CloneNode(true);
1
2372
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") Dim newElem As XmlElement = myDoc.CreateElement("sender") newElem.SetAttribute("schemaVersion", "1.0") newElem.SetAttribute("xmlns", "http://www.somewhere.org") newElem.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
0
559
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 schema validation, it tries to find that DTD. I want that LoadXml function should not find the DTD even though xml string has a reference to it.
4
8279
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
2172
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 = "http://www.mysite.com/setup.xml" xmlDoc = New XmlDataDocument xmlDoc.Load(URL) Anyone can help me?
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.