dataset getxml xml formatting

  • Thread starter Thread starter Mark
  • Start date Start date
M

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
 
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"
 
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
 
Back
Top