Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to read the XML using C#?
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/12246449/how-to-read-xml-node-from-url-using-c">How to read XML node from URL using C#?</a> </p> </blockquote> <p>I'm having below XML, I want to read this XML URL using C#</p> <pre><code>&lt;result&gt; &lt;Accounts&gt; &lt;row no="1"&gt; &lt;FL val="ACCOUNTID"&gt;012345678&lt;/FL&gt; &lt;FL val="SMOWNERID"&gt;012345678&lt;/FL&gt; &lt;FL val="Account Owner"&gt; &lt;![CDATA[ demo name]]&gt; &lt;/FL&gt; &lt;FL val="Account Name"&gt; &lt;![CDATA[ demo ]]&gt; &lt;/FL&gt; &lt;FL val="Phone"&gt; &lt;![CDATA[ +12 34 5567 345]]&gt; &lt;/FL&gt; &lt;FL val="Account Site"&gt; &lt;![CDATA[ demo]]&gt; &lt;/FL&gt; </code></pre> <p>I have used below code for reading XML from URL but i'm getting below output in console </p> <pre><code>&lt;FL val="Account Name"&gt; &lt;![CDATA[ demo ]]&gt; &lt;/FL&gt; &lt;FL val="Phone"&gt; &lt;/FL&gt; &lt;FL val="Account Site"&gt; &lt;/FL&gt; </code></pre> <p>My code is below :</p> <pre><code>String xmlURL = "http://localhost/my.xml"; XmlTextReader xmlReader = new XmlTextReader(xmlURL); while (xmlReader.Read()) { switch (xmlReader.NodeType) { case XmlNodeType.Element: // The node is an element. Console.Write("&lt;" + xmlReader.Name); while (xmlReader.MoveToNextAttribute()) // Read the attributes. Console.Write(" " + xmlReader.Name + "=’" + xmlReader.Value + "’"); Console.WriteLine("&gt;"); break; case XmlNodeType.Text: //Display the text in each element. Console.WriteLine(xmlReader.Value); break; case XmlNodeType.EndElement: //Display the end of the element. Console.Write("&lt;/" + xmlReader.Name); Console.WriteLine("&gt;"); break; } } Console.WriteLine("Press any key to continue…"); Console.ReadLine(); //Pause </code></pre> <p>Please help to read the inside data</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload