473,757 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

encoding xml genned by the getxml method of a dataset

I have a basic question about xml encoding and predefined characters
in xml. I know that characters such as "<" get encoded to &lt; My
question is when does this actually happen? I'm using the getxml()
method of a dataset to build my xml, but before I send it to the
server, I prepend an encoding scheme of UTF-8. Does just adding this
declaration correctly encode the characters on the way to the server
or does it already expect them to be in in the dataset prior to
calling getxml ?

Thanks,
Mark
Nov 12 '05 #1
1 3517
Mark wrote:
I have a basic question about xml encoding and predefined characters
in xml. I know that characters such as "<" get encoded to &lt; My
question is when does this actually happen?
Whenever XML is being serialized to bytes/created/written.

I'm using the getxml()
method of a dataset to build my xml, but before I send it to the
server, I prepend an encoding scheme of UTF-8.


Character encoding has nothing to do with escaping of < and &
characters, it's completely different things. In any XML document, in
any character encoding < and & must be escaped as &lt; and &amp;.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

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

Similar topics

0
604
by: softengine | last post by:
I have a dataset with multiple tables I need exported to Excel. I can get it into Excel into one worksheet however I want there to be one worksheet for each datatable in the dataset. If I dump my xml string from the getXML method into Excel it puts all the data from the tables into the same worksheet. I am using the XMLImportXML method that's available with Office 2003. Do I have to loop through each datatable and use getXML and...
4
4525
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
4386
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
2021
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
3
4540
by: Mark | last post by:
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...
1
1850
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...
2
1283
by: Ganesh Muthuvelu | last post by:
Hello, I have a schema that contains two "choice" elements, say "F1" and "F2" - meaning either F1 or F2 can be present but not both. I loaded this schema into a dataset, which created two columns in the datatable "F1" and "F2". Now, I load the dataset with a value for F1 and not for F2. When I use the GetXML method of the dataset, the output produces both elements F1 and F2, like shown below: <F1>value1</F1>
1
1621
by: lucky | last post by:
Hi guys! i've filled the DatSet object and was trying to get xml data from it. i used GetXml() method for that. it worked fine when all columns of the datatable has data. it generates perfectly fine xml but when if one column in datatable has no data(null), the method doesnt generates xml for that column. for example :
3
2103
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
9487
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
10069
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
9904
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...
0
9735
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...
0
8736
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
7285
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
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
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 we have to send another system
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.