473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Handling Double Quote in Xml

HI All

How Can I handle the Double Quote in xml when i am trying
to write the Xml File From XmTextWriter Class in
System.Xml NameSpace

When I try to Write DoubleQoute(") From dataSet to xml File
it Replaces Doubly Quote by (_x0022) by this
<_x002_MapName>ProjectName</_x002_MapName>

Or If there is Any Comma it does like this
<_x002C_MapName>ProjectName</_x002C_MapName>

Tell me How Can I handle This
Thanks and Regards
Amit Goel
Project Engineer
..NET group, Global MicroSoft Business Unit (GMSBU)
Wipro Technologies, Madhapur, Hyderabad, India
Phone: +91-40-55565742 (direct);
+91-98480-80139 (mobile)

Double Quote in xml File
Nov 11 '05 #1
4 8961
Amit Goel wrote:
How Can I handle the Double Quote in xml when i am trying
to write the Xml File From XmTextWriter Class in
System.Xml NameSpace

When I try to Write DoubleQoute(") From dataSet to xml File
it Replaces Doubly Quote by (_x0022) by this
<_x002_MapName>ProjectName</_x002_MapName>

Or If there is Any Comma it does like this
<_x002C_MapName>ProjectName</_x002C_MapName>

Tell me How Can I handle This

I don't think you have to handle this. This is corrct behaviour. Quotes and
commas are not allowed in element names in XML, so they get escaped. What's
wrong with that?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Amit Goel wrote:
How Can I handle the Double Quote in xml when i am trying
to write the Xml File From XmTextWriter Class in
System.Xml NameSpace


Probably I mistunderstood you.
To get names encoded and decoded make use of XmlConvert.EncodeName() and
XmlConvert.DecodeName() methods.
Just pass each element name through XmlConvert.EncodeName() before calling
WriteStartElement().
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3
You are trying to write the quote as an element name, which is not allowed
in XML. Try writing it as a text node value or attribute value using
XmlTextWriter.WriteString method.

-Helena Kupkova, MS

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"Amit Goel" <am*******@wipro.com> wrote in message
news:1f****************************@phx.gbl...
HI All

How Can I handle the Double Quote in xml when i am trying
to write the Xml File From XmTextWriter Class in
System.Xml NameSpace

When I try to Write DoubleQoute(") From dataSet to xml File
it Replaces Doubly Quote by (_x0022) by this
<_x002_MapName>ProjectName</_x002_MapName>

Or If there is Any Comma it does like this
<_x002C_MapName>ProjectName</_x002C_MapName>

Tell me How Can I handle This
Thanks and Regards
Amit Goel
Project Engineer
.NET group, Global MicroSoft Business Unit (GMSBU)
Wipro Technologies, Madhapur, Hyderabad, India
Phone: +91-40-55565742 (direct);
+91-98480-80139 (mobile)

Double Quote in xml File

Nov 11 '05 #4
One thing I have done is to use the HttpUtility to HtmlEncode just before
saving to Xml, then when reading the Xml back I have to HtmlDecode.

this changes the " to &quot;

Severin


"Amit Goel" <am*******@wipro.com> wrote in message
news:1f****************************@phx.gbl...
HI All

How Can I handle the Double Quote in xml when i am trying
to write the Xml File From XmTextWriter Class in
System.Xml NameSpace

When I try to Write DoubleQoute(") From dataSet to xml File
it Replaces Doubly Quote by (_x0022) by this
<_x002_MapName>ProjectName</_x002_MapName>

Or If there is Any Comma it does like this
<_x002C_MapName>ProjectName</_x002C_MapName>

Tell me How Can I handle This
Thanks and Regards
Amit Goel
Project Engineer
.NET group, Global MicroSoft Business Unit (GMSBU)
Wipro Technologies, Madhapur, Hyderabad, India
Phone: +91-40-55565742 (direct);
+91-98480-80139 (mobile)

Double Quote in xml File

Nov 11 '05 #5

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

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
27
by: garyolsen | last post by:
In C++ what kind of unexpected conditions should be handled as exceptions? Besides dividing by 0, bad memory allocation, what're the most popular exceptions? When should not use exception,...
12
by: Siemel Naran | last post by:
What is a good idiom for handling a lazy object? I see 2 good possibilities. Any more, any comments? Which way do people here use? (1) class Thing { public: Thing(double x, double y) :...
5
by: Mateusz Loskot | last post by:
Hi, I'd like to ask how XML parsers should handle attributes which consists of &quot; entity as value. I know XML allows to use both: single and double quotes as attribute value terminator. That's...
2
by: John Dann | last post by:
This question has arisen from an earlier thread but is really a separate issue: I have a VB.Net listbox control on a form. I want to be able to do 2 things with items displayed within the one...
44
by: Kulgan | last post by:
Hi I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text). I have two main questions: 1. Does IE automaticall...
35
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks...
7
by: A.E lover | last post by:
Dear all, In C, I am wondering what codes will run faster: assuming, I have two arrays: dounle a, double code 1:
9
by: Chad | last post by:
This might be a bit vague and poorly worded..... In my program, I handle function failures using fprintf() and exit() like: fprintf(stderr, "malloc failed"); exit(EXIT_FAILURE); There...
1
by: George2 | last post by:
Hello everyone, Such code segment is used to check whether function call or exception- handling mechanism runs out of memory first (written by Bjarne), void perverted() { try{
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.