473,834 Members | 1,904 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 4542
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.Strin gWriter
ds.WriteXml(sw)
Dim mystring As String = sw.tostring
///
Deserialize
\\\
Dim sr As New System.IO.Strin gReader(mystrin g)
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.c om (Mark) wrote in message news:<f4******* *************** ****@posting.go ogle.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
5823
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
1626
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() function to return the embedded nodes as an Attribute of an entity and not ChildNodes, e.g. The DataSet's GetXml function returns like this <File> <FileName>some.xml</FileName>
4
4526
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 dataset is returned. Is there a method of getting the XML from the dataview / datagrid / dataset that applies the filter applied in the dataview? Thanks in advance.
2
4388
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 am querying, is CLOB data in XML format.
1
2023
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 behaviour Suppose I have this dataset Col1 Col2 Col3 Col ----- ---- ---- --- A1 A2 A3 A
5
10638
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 the dataset because I don't know what datatype to set the dataset column and then set this image to. I saw an example where someone defended a datatable in the global class and defined the column as an object, however, when I define a strongly...
22
25612
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 compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet = ws.VerifySku(cartSet)
1
1851
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 a DataSet, and sends back to the user the DataSet.GetXml() (I know that a Dataset is serializable, but i need it's xml. anyway, this method does not create tags with no values in the output xml, in case a certain field in the DB equals...
3
2106
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 correctly. If I later try to display the XML content in the asp:Literal control, then I get "<NewDataSet />". Why is that? Why can't I get the actual XML back from the DataSet? I'm new to DataSets, so I'm probably just missing something basic. Here's...
0
9799
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
10795
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
10512
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9332
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7760
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
6957
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3981
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3083
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.