Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use an xml in my application

the woking xml is

C#
<pre>rasol.Send("<iq to='" + textBox1.Text  + "@jabber.org' type='get' id='mir635'><query xmlns='http://jabber.org/protocol/profile'/></iq>");


But my textbox already contained full JID like jid@jabber.org so i removed "@jabber.org"

since i removed it the xml is stopped working.

project.Send("<iq to='" + textBox1.Text + "' type='get' id='mir653'><query xmlns='http://jabber.org/protocol/profile'/></iq>");


i think there is some error in ' "
Posted
Updated 22-Jul-14 5:19am
v4
Comments
PIEBALDconsult 22-Jul-14 12:15pm    
Try storing the XML in a local variable so you can examine it before passing it to Send.
Member 10579673 22-Jul-14 12:16pm    
how to do that?

1 solution

.NET FCL suggests different ways of working with XML which you should better be familiar with, all of them. This is my short overview of them:

  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^].
  2. Use the classes System.Xml.XmlTextWriter and System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx[^], http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^].
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].


—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900