Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML Parsing

ISTANBUL
ANKARA
ADANA
ADIYAMAN
AFYON
AGRI
AKSARAY
AMASYA
ANTALYA
ARDAHAN
ARTVIN
AYDIN
BALIKESIR
BARTIN
BATMAN
BAYBURT
BILECIK
BINGOL
BITLIS
BOLU
BURDUR
BURSA
CANAKKALE
CANKIRI
CORUM
DENIZLI
DIYARBAKIR
DUZCE
EDIRNE
ELAZIG
ERZINCAN
ERZURUM
ESKISEHIR
GAZIANTEP
GIRESUN
GUMUSHANE
HAKKARI
HATAY
IGDIR
ISPARTA
IZMIR
KAHRAMANMARAS
KARABUK
KARAMAN
KARS
KASTAMONU
KAYSERI
KILIS
KIRIKKALE
KIRKLARELI
KIRSEHIR
KOCAELI
KONYA
KUTAHYA
MALATYA
MANISA
MARDIN
MERSIN
MUGLA
MUS
NEVSEHIR
NIGDE
ORDU
OSMANIYE
RIZE
SAKARYA
SAMSUN
SANLIURFA
SIIRT
SINOP
SIRNAK
SIVAS
TEKIRDAG
TOKAT
TRABZON
TUNCELI
USAK
VAN
YALOVA
YOZGAT
ZONGULDAK
Posted 29-Dec-12 11:05am
ct_12409
Comments
Mika Wendelius at 29-Dec-12 17:07pm
   
The list you posted isn't XML but just a lost of text. Where is it stored? In a file? Do you need to get the list from file or something else?
Member 9718083 at 29-Dec-12 17:10pm
   
Im sorry there was a mistake , here is the url http://www.namaz.web.tr/namazVakitleriApi.php?ilListesi=1
Sergey Alexandrovich Kryukov at 29-Dec-12 21:39pm
   
There is no XML here.
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

One way is to load the data into a XmlDocument and then extract the nodes using the tag.
 
The following example has the data embedded directly in the code, but I take it you should first fetch it from somewhere else. Note that the list is only partial to prevent too long code example:
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
         xmlDoc.LoadXml(@"
<sehirListesi>
<sehir>ISTANBUL</sehir>
<sehir>ANKARA</sehir>
<sehir>ADANA</sehir>
<sehir>ADIYAMAN</sehir>
<sehir>AFYON</sehir>
<sehir>BAYBURT</sehir>
<sehir>BILECIK</sehir>
<sehir>BINGOL</sehir>
<sehir>BITLIS</sehir>
<sehir>BOLU</sehir>
<sehir>BURDUR</sehir>
<sehir>BURSA</sehir>
<sehir>CANAKKALE</sehir>
<sehir>CANKIRI</sehir>
<sehir>CORUM</sehir>
<sehir>DENIZLI</sehir>
<sehir>KUTAHYA</sehir>
<sehir>SIRNAK</sehir>
<sehir>SIVAS</sehir>
<sehir>TEKIRDAG</sehir>
<sehir>TOKAT</sehir>
<sehir>TRABZON</sehir>
<sehir>TUNCELI</sehir>
<sehir>USAK</sehir>
<sehir>VAN</sehir>
<sehir>YALOVA</sehir>
<sehir>YOZGAT</sehir>
<sehir>ZONGULDAK</sehir>
</sehirListesi>");
         foreach (System.Xml.XmlNode node in xmlDoc.GetElementsByTagName("sehir")) {
            System.Diagnostics.Debug.WriteLine(node.InnerText);
         }
  Permalink  
v2
Comments
Espen Harlinn at 30-Dec-12 8:09am
   
5'ed!
Mika Wendelius at 4-Jan-13 15:13pm
   
Thanks :D

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



Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 29 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100