XML element

  • Thread starter Thread starter Swappy
  • Start date Start date
S

Swappy

hi
how can i write in xml the following data

i have <Text> </Text>

in this i want to write "1 <== 2"

i know for < the escape character is &lt but it is giving me error that ( ;
is expected)
How can i write <== in XML
 
how can i write in xml the following data

i have <Text> </Text>

in this i want to write      "1 <==  2"

i know for < the escape character is &lt but it is giving me error that (;
is expected)
How can i write <== in XML

It's not just &lt it's &lt; that you need.

Jon
 
As an aside, note that any of the xml utilities will get this right for
you, saving the pain of having to know every rule. This could be
XmlWriter, XmlDocument, or XDocument (just for starters). For example:

string xml = new XElement("Text", "1 <== 2").ToString();
// gives said:
It's not just &lt it's &lt; that you need.

Maybe it is just me, but I want to insert a semi-colon in there for
/grammar/ reasons - which would have been very confusing...

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top