Inputting special characters inside xml

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
How to input special characters inside xml like < (Less than) , >
(Greater than) as a text

Thanks,
 
You encode < as &lt; and > as &gt;

But I get the feeling you already know that and its something else you are asking. Can you be more specific if the above doesn't give you what you want.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Hello,
How to input special characters inside xml like < (Less than) , >
(Greater than) as a text

Thanks,
 
Hello,

I want to represent expression having >= and <= as text so that that
can be read in an dataset

Thanks,
 
Well, looking at my post it has nicely translated my encodings into the < and > sign <sigh>. OK here are the encodings, but I'll put spaces between so you can read them

< = & l t ;
= & g t ;

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Hello,

I want to represent expression having >= and <= as text so that that
can be read in an dataset

Thanks,
 
Isn't there a "raw" or "string" xml element type so you can put any string
in without the special chars (i.e. a formatted xml string.)? I thought I
remember reading something on that.

--
William Stacey, MVP
http://mvp.support.microsoft.com

Richard Blewett said:
Well, looking at my post it has nicely translated my encodings into the <
 
Using the XmlTextWriter you can use WriteRaw method to write raw markup
to the XML file.
However, AFAIK, there is no DOM approach that will allow this.
 
Although, of course, you can actually set the InnerXml/OuterXml
properties of a given DOM node(XmlNode), which is kind of cool.
 
Back
Top