By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,270 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,270 IT Pros & Developers. It's quick & easy.

dataset getxml xml formatting

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
I thought I showed you the solution, what is wrong with it?

Cor
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.