Home All Groups Group Topic Archive Search About

Special Characters(&,etc..) in a string between xml tags

Author
26 Jul 2006 3:35 AM
NAT
I have a xml open and close tag <abc> </abc>. I assign a string variable to
this tag. <abc> & NAT & </abc> . The value of the variable NAT = Cal&FLo. But
due to the presence of the ampersand. There is an exception. What do I need
to do to display & nd other special chracters correctly in xml tags.

Author
26 Jul 2006 10:00 AM
Herfried K. Wagner [MVP]
"NAT" <N**@discussions.microsoft.com> schrieb:
>I have a xml open and close tag <abc> </abc>. I assign a string variable to
> this tag. <abc> & NAT & </abc> . The value of the variable NAT = Cal&FLo.
> But
> due to the presence of the ampersand. There is an exception. What do I
> need
> to do to display & nd other special chracters correctly in xml tags.

"&" -> "&amp;".

<URL:http://groups.google.de/group/microsoft.public.de.german.entwickler.dotnet.vb/browse_frm/thread/43752abd5ca5b1de/aa4cfc5ab26203d8>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
26 Jul 2006 10:13 AM
MyndPhlyp
"NAT" <N**@discussions.microsoft.com> wrote in message
news:4760C26A-ECE6-42CF-A72D-187135FD37ED@microsoft.com...
> I have a xml open and close tag <abc> </abc>. I assign a string variable
to
> this tag. <abc> & NAT & </abc> . The value of the variable NAT = Cal&FLo.
But
> due to the presence of the ampersand. There is an exception. What do I
need
> to do to display & nd other special chracters correctly in xml tags.

See if this helps...

http://www.w3.org/TR/xhtml1/

See: Section C.12 - Using Ampersands in Attribute Values (and Elsewhere)

....or, for the impatient, try using &amp; instead of the ampersand
character.