How to read xml data of item by item add space in c# windows form application

  • Thread starter Thread starter Viraj Rathnayake
  • Start date Start date
V

Viraj Rathnayake

Guest
My issue is this my application label text is xml data.. But it's showing continuously.

I want to read item by item add space or star mark to distinguish..

This is my code..

public void xmlnewsreader()
{
string url = @"\\SERVERML310\desktop\News Ticker\News Ticker\News Ticker\Resources\News.xml";
XmlReader reader = XmlReader.Create(url);
SyndicationFeed feed = SyndicationFeed.Load(reader);
reader.Close();
foreach (SyndicationItem item in feed.Items)
{
String subject = item.Title.Text;
String summary = item.Summary.Text;
label2.Text += subject;
}

}

Please help me..

this is my xml file..

<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<?xml-stylesheet type="text/xsl" href="rss.xsl"?>
<channel>
<title>AdaDerana RSS</title>
<atom:link href="AdaDerana RSS" rel="self" type="application/rss+xml" />
<link>AdaDerana RSS</link>
<description>AdaDerana RSS</description>
<language>en-us</language>
<pubDate>Thu, 18 Jun 2020 13:12:53 +0530</pubDate><item><title>COVID-19- Recoveries hit 1,421 as more patients regain health</title>
<pubDate>Thu, 18 Jun 2020 13:09:11 +0530</pubDate>
<link>COVID-19: Recoveries hit 1,421 as more patients regain health</link>
<guid>COVID-19: Recoveries hit 1,421 as more patients regain health</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...hit-1421-as-more-patients-regain-health-A.jpg' width='60' align='left' hspace='5'/>Twenty-four more COVID-19-infected patients under medical care were discharged from hospitals today (18) as they have recovered completely. MORE..]]></description>
</item><item><title>Court rejects Sajin Vass request for interim injunction</title>
<pubDate>Thu, 18 Jun 2020 13:00:50 +0530</pubDate>
<link>Court rejects Sajin Vass request for interim injunction</link>
<guid>Court rejects Sajin Vass request for interim injunction</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...jin-Vass-request-for-interim-injunction-A.jpg' width='60' align='left' hspace='5'/>The Appeal Court rejected a petition seeking an interim injunction on the hearing of a case filed by the Attorney General against former MP Sajin de Vass Gunawardena on money laundering. MORE..]]></description>
</item><item><title>Levy for exporting tea suspended for 6 months</title>
<pubDate>Thu, 18 Jun 2020 11:28:53 +0530</pubDate>
<link>Levy for exporting tea suspended for 6 months</link>
<guid>Levy for exporting tea suspended for 6 months</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...for-exporting-tea-temporarily-suspended-A.jpg' width='60' align='left' hspace='5'/>The levy on the export of tea has been temporarily suspended for a period of 6 months, said Minister Ramesh Pathirana. MORE..]]></description>
</item><item><title>Rayshard Brooks shooting- US policeman faces murder charge</title>
<pubDate>Thu, 18 Jun 2020 11:06:25 +0530</pubDate>
<link>Rayshard Brooks shooting: US policeman faces murder charge</link>
<guid>Rayshard Brooks shooting: US policeman faces murder charge</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ooting-US-policeman-faces-murder-charge-A.jpg' width='60' align='left' hspace='5'/>An Atlanta police officer was charged on Wednesday with murder for the shooting death last week of Rayshard Brooks in a fast-food parking lot, while a fellow officer facing lesser charges has agreed to testify against his colleague. MORE..]]></description>
</item><item><title>Police Media Spokesman elevated to SSP rank</title>
<pubDate>Thu, 18 Jun 2020 10:51:56 +0530</pubDate>
<link>Police Media Spokesman elevated to SSP rank</link>
<guid>Police Media Spokesman elevated to SSP rank</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ce-Media-Spokesman-promoted-to-SSP-rank-A.jpg' width='60' align='left' hspace='5'/>Police Media Spokesperson Superintendent of Police (SP) Jaliya Senaratne has been promoted to the rank of Senior Superintendent of Police (SSP). MORE..]]></description>
</item><item><title>Stab attack on Kanjipani Imran s father recorded in CCTV</title>
<pubDate>Thu, 18 Jun 2020 10:33:10 +0530</pubDate>
<link>Stab attack on Kanjipani Imrans father recorded in CCTV</link>
<guid>Stab attack on Kanjipani Imrans father recorded in CCTV</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...anjipani-Imrans-father-recorded-in-CCTV-A.jpg' width='60' align='left' hspace='5'/>Notorious drug dealer Kanjipani Imran s father has been stabbed by three individuals near his house in Maligawatta last evening (17). MORE..]]></description>
</item><item><title>Easter attacks investigations near conclusion – Police Spokesman</title>
<pubDate>Thu, 18 Jun 2020 10:20:51 +0530</pubDate>
<link>Easter attacks investigations near conclusion Police Spokesman</link>
<guid>Easter attacks investigations near conclusion Police Spokesman</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ations-near-conclusion-Police-Spokesman-A.jpg' width='60' align='left' hspace='5'/>Investigations pertaining to the 2019 Easter Sunday attacks are expected to be concluded soon, stated the Police Media Spokesperson SP Jaliya Senaratne. MORE..]]></description>
</item><item><title>COVID-19 recoveries from Navy climb to 748</title>
<pubDate>Thu, 18 Jun 2020 10:13:47 +0530</pubDate>
<link>COVID-19 recoveries from Navy climb to 748</link>
<guid>COVID-19 recoveries from Navy climb to 748</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazonaws.com/1592455649-COVID-19-recoveries-from-Navy-at-748-A.jpg' width='60' align='left' hspace='5'/>Eight more naval personnel who had contracted the COVID-19 have recovered completely from the disease, says Sri Lanka Navy. MORE..]]></description>
</item><item><title>Coronavirus case count in Sri Lanka at 1,924</title>
<pubDate>Thu, 18 Jun 2020 09:38:48 +0530</pubDate>
<link>Coronavirus case count in Sri Lanka at 1,924</link>
<guid>Coronavirus case count in Sri Lanka at 1,924</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...navirus-case-count-in-Sri-Lanka-at-1924-A.jpg' width='60' align='left' hspace='5'/>The total number of COVID-19 patients recorded in Sri Lanka now stands at 1,924 with nine new cases being reported yesterday (17). MORE..]]></description>
</item><item><title>Itukuma COVID–19 Fund balance surpasses Rs. 1,386 million</title>
<pubDate>Thu, 18 Jun 2020 08:46:05 +0530</pubDate>
<link>Itukuma COVID19 Fund balance surpasses Rs. 1,386 million</link>
<guid>Itukuma COVID19 Fund balance surpasses Rs. 1,386 million</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazonaws.com/1592450165-itukama-covid-19-fund-balance-0.jpg' width='60' align='left' hspace='5'/>Following corporate, individual donations and direct deposits, the ITUKAMA COVID-19 Healthcare and Social Security Fund s balance has now surpassed Rs. 1,386 million. MORE..]]></description>
</item><item><title>India elected non-permanent member of UN Security Council</title>
<pubDate>Thu, 18 Jun 2020 08:14:04 +0530</pubDate>
<link>India elected non-permanent member of UN Security Council</link>
<guid>India elected non-permanent member of UN Security Council</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazonaws.com/1592448418-india-un-security-council-0.jpg' width='60' align='left' hspace='5'/>India was elected as non-permanent member of the powerful United Nations Security Council for a two-year term on June 17, winning 184 votes in the 193-member General Assembly. MORE..]]></description>
</item><item><title>289 Sri Lankans repatriated from Dubai</title>
<pubDate>Thu, 18 Jun 2020 07:48:08 +0530</pubDate>
<link>289 Sri Lankans repatriated from Dubai</link>
<guid>289 Sri Lankans repatriated from Dubai</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazonaws.com/1592447781-srilankan-airlines-flight-0.jpg' width='60' align='left' hspace='5'/>A group of 290 Sri Lankan migrant workers, who were stranded in the United Arab Emirates due to the global Covid-19 pandemic, reached the Bandaranaike International Airport (BIA) in Katunayake this morning onboard a special repatriation flight. MORE..]]></description>
</item><item><title>President assures free and fair election under strict health guidelines</title>
<pubDate>Thu, 18 Jun 2020 00:49:44 +0530</pubDate>
<link>President assures free and fair election under strict health guidelines</link>
<guid>President assures free and fair election under strict health guidelines</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...election-under-strict-health-guidelines-A.jpg' width='60' align='left' hspace='5'/>President Gotabaya Rajapaksa assured to create the background to hold a free and fair election while giving priority to the health protection of the people. MORE..]]></description>
</item><item><title>Farmers and fishermen s pensions for June available from Monday</title>
<pubDate>Thu, 18 Jun 2020 00:05:03 +0530</pubDate>
<link>Farmers and fishermens pensions for June available from Monday</link>
<guid>Farmers and fishermens pensions for June available from Monday</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ensions-for-June-available-from-June-22-A.jpg' width='60' align='left' hspace='5'/>All have been made to make provisions for the payment of farmers and fishermen s pensions for June to all post offices in the country by June 20, stated the Agricultural and Agrarian Insurance Board. MORE..]]></description>
</item><item><title>I cannot take responsibility for Easter attacks – former President</title>
<pubDate>Wed, 17 Jun 2020 23:50:49 +0530</pubDate>
<link>I cannot take responsibility for Easter attacks former President</link>
<guid>I cannot take responsibility for Easter attacks former President</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ity-for-Easter-attacks-Former-President-A.jpg' width='60' align='left' hspace='5'/>Former President Maithripala Sirisena says he is not responsible for the 2019 Easter Sunday terror attacks. MORE..]]></description>
</item><item><title>Foreign currency term financing facility to be raised to finance Vote on Account</title>
<pubDate>Wed, 17 Jun 2020 22:12:35 +0530</pubDate>
<link>Foreign currency term financing facility to be raised to finance Vote on Account</link>
<guid>Foreign currency term financing facility to be raised to finance Vote on Account</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...to-be-raised-to-finance-Vote-on-Account-A.jpg' width='60' align='left' hspace='5'/>The government intends to raise foreign currency term financing facility up to a limit in 2020 to finance the Vote on Account, stated the Ministry of Finance. MORE..]]></description>
</item><item><title>Kanjipani Imran s father stabbed in Maligawatta</title>
<pubDate>Wed, 17 Jun 2020 21:34:18 +0530</pubDate>
<link>Kanjipani Imrans father stabbed in Maligawatta</link>
<guid>Kanjipani Imrans father stabbed in Maligawatta</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ni-Imrans-father-stabbed-in-Maligawatta-A.jpg' width='60' align='left' hspace='5'/>An individual has been injured in a stabbing incident at Maligawatta area, stated Police Media Spokesman. MORE..]]></description>
</item><item><title>Pay in installments if electricity bill is higher than in February - CEB</title>
<pubDate>Wed, 17 Jun 2020 19:29:04 +0530</pubDate>
<link>Pay in installments if electricity bill is higher than in February - CEB</link>
<guid>Pay in installments if electricity bill is higher than in February - CEB</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...ity-bill-is-higher-than-in-February-CEB-A.jpg' width='60' align='left' hspace='5'/>President Gotabaya Rajapaksa has inquired into any possible issue with the electricity bills issued for the past few months. MORE..]]></description>
</item><item><title>Coronavirus cases in Sri Lanka climb to 1,923</title>
<pubDate>Wed, 17 Jun 2020 18:21:28 +0530</pubDate>
<link>Coronavirus cases in Sri Lanka climb to 1,923</link>
<guid>Coronavirus cases in Sri Lanka climb to 1,923</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...avirus-cases-in-Sri-Lanka-climb-to-1923-A.jpg' width='60' align='left' hspace='5'/>Two more individuals are confirmed to have contracted the novel coronavirus, hiking the total number of cases recorded in the country to 1,923. MORE..]]></description>
</item><item><title>Six more test positive for COVID-19; tally at 1,921</title>
<pubDate>Wed, 17 Jun 2020 17:23:58 +0530</pubDate>
<link>Six more test positive for COVID-19; tally at 1,921</link>
<guid>Six more test positive for COVID-19; tally at 1,921</guid>
<description><![CDATA[<img src='https://adaderanaenglish.s3.amazona...from-Chennai-test-positive-for-COVID-19-A.jpg' width='60' align='left' hspace='5'/>Six more COVID-19 individuals have tested COVID-19 positive, the Ministry of Health confirmed. MORE..]]></description>
</item></channel></rss>

Continue reading...
 
Back
Top