473,509 Members | 6,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dataset getxml xml formatting

I have run into a problem that I have not found an easy solution for.
My data all resides in a dataset and we're using getxml to return the
xml and send that on to the webserver for processing. It seems though
that the getxml method always wants to create formatted xml (see
example below). I don't want it like that and want it in a single
line. I haven't been able to find an easy way to do this, because I
can't just strip spaces/crlf because spaces might be a valid part of
the data. I thought someone out there might have some ideas on a
simple solution to this.

Example: (getxml creates this in the string)
<Tag1>
<Tag2>A</Tag2>
</Tag1>

What I want is:
<Tag1><Tag2>A</Tag2></Tag1>

Many Thanks....
Mark
Nov 21 '05 #1
3 4522
Mark,

I thought that your solution is in this snippet beneath that I once made?

I hope this helps?

Cor

Serialize
\\\\
Dim sw As New System.IO.StringWriter
ds.WriteXml(sw)
Dim mystring As String = sw.tostring
///
Deserialize
\\\
Dim sr As New System.IO.StringReader(mystring)
Dim ds2 As New DataSet
ds2.ReadXml(sr)
///

I hope this helps a little bit?

Cor
"Mark"
I have run into a problem that I have not found an easy solution for.
My data all resides in a dataset and we're using getxml to return the
xml and send that on to the webserver for processing. It seems though
that the getxml method always wants to create formatted xml (see
example below). I don't want it like that and want it in a single
line. I haven't been able to find an easy way to do this, because I
can't just strip spaces/crlf because spaces might be a valid part of
the data. I thought someone out there might have some ideas on a
simple solution to this.

Example: (getxml creates this in the string)
<Tag1>
<Tag2>A</Tag2>
</Tag1>

What I want is:
<Tag1><Tag2>A</Tag2></Tag1>

Many Thanks....
Mark

Nov 21 '05 #2
Ok, I have since found I can use the .outerxml method of an
xmldatadocument to do this, but now I need to determine how to get the
data from my dataset to the xmldatadocument.

If there is still a way to do this without going through the
xmldatadocument, please let me know.

Mark

ma*****@yahoo.com (Mark) wrote in message news:<f4**************************@posting.google. com>...
I have run into a problem that I have not found an easy solution for.
My data all resides in a dataset and we're using getxml to return the
xml and send that on to the webserver for processing. It seems though
that the getxml method always wants to create formatted xml (see
example below). I don't want it like that and want it in a single
line. I haven't been able to find an easy way to do this, because I
can't just strip spaces/crlf because spaces might be a valid part of
the data. I thought someone out there might have some ideas on a
simple solution to this.

Example: (getxml creates this in the string)
<Tag1>
<Tag2>A</Tag2>
</Tag1>

What I want is:
<Tag1><Tag2>A</Tag2></Tag1>

Many Thanks....
Mark

Nov 21 '05 #3
I thought I showed you the solution, what is wrong with it?

Cor
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5809
by: mr_dom_is | last post by:
Hi I have a little bit of trouble, probably missing the point now sure but: I have a dataset dim ds as new dataset("User") Which is populated with data from a database. When I use
1
1611
by: Sunny | last post by:
Hi, I am trying to use the GetXml() function of my DataSet, and its returning all the rows and their values correctly in Elements format. How can i change this default behaviour of the GetXml()...
4
4516
by: Chris | last post by:
I apply a dataview with a filter to a datagrid to remove rows that a user does not want to see. However when I attempt to extract the data from the underlying dataset using GetXML() the entire...
2
4377
by: Rajesh AVRS | last post by:
Hi guys I have a requirement where I needed to extract the DataSet contents as XML. After filling the dataset, I am calling GetXml() and is working fine. However, one of the column which I...
1
2004
by: Kashyap | last post by:
Hi I am trying to convert a dataset to xml using dataset.getxml. But this xml doesn't contain elements for null columns that are present in the dataset. How can we explicitly control this...
5
10610
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into...
22
25549
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
1
1834
by: Elad | last post by:
hi, I'm sorry if this isn't the right group, I just didnt know which category to place this question in. Anyway, I have 2 problems: I got a web service which connects to a DB and puts the data in...
3
2092
by: Greg Collins [Microsoft MVP] | last post by:
I have a SQL2005 XML column I load into a DataSet. I then bind to a DataGrid. If I set an asp:Literal text value to the DataSet.GetXml() when I first load it into the DataSet, it displays...
0
7137
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...
0
7347
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,...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
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...
1
5062
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...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
443
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...

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.