473,399 Members | 3,106 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,399 software developers and data experts.

Still one question!

Hello again!

I wrote a small Windows App that converts
characters to XML.

Code below:
StringBuilder sb = new StringBuilder();

new System.Xml.XmlTextWriter(new

StringWriter(sb)).WriteString(this.txtBoxFrom.Text );

this.txtBoxTo.Text = sb.ToString();

If I give & to txtBoxFrom field it writes & to txtBoxTo field

but when givin " it writes " not " that it should write.

Can anyone point what is still missing?

Cheers!
Mar 7 '07 #1
1 1626
Jo M wrote:
If I give & to txtBoxFrom field it writes & to txtBoxTo field

but when givin " it writes " not " that it should write.

Can anyone point what is still missing?
" is allowed in XML, there is no need to escape it unless you use it
inside of an attribute value where the value is already delimited by
double quotes. Thus if you want to write XML markup that is properly
escaped then write the complete markup with an XmlWriter, it has methods
to write out attributes and will do all escaping necessary. The snippet
you used does not write an attribute value so there no escaping of the
double quote is necessary.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 8 '07 #2

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

Similar topics

687
by: cody | last post by:
no this is no trollposting and please don't get it wrong but iam very curious why people still use C instead of other languages especially C++. i heard people say C++ is slower than C but i can't...
5
by: The Bicycling Guitarist | last post by:
Some years ago I implemented the well-known @import trick to not confuse netscape 4 users. Is this still necessary? The relevant style sheets are...
39
by: jaad | last post by:
There are literally thousands and thousands of entry about this subject but still after 6 years of looking and researching I haven't found a simple answer to a really simple question: I have two...
15
by: didacticone | last post by:
i have a form that i view in the continuous forms view. i have added a search feature to the form by creating two unbound text boxes and creating a search button with the following code... Private...
2
by: phrio | last post by:
I am looking to have a full client server architecture built for a innovative new service that will require a number of large databases to be built, an iphone app and an interactive website with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.