Click here to Skip to main content
12,953,223 members (45,395 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
<sehirlistesi>
<sehir>ISTANBUL
<sehir>ANKARA
<sehir>ADANA
<sehir>ADIYAMAN
<sehir>AFYON
<sehir>AGRI
<sehir>AKSARAY
<sehir>AMASYA
<sehir>ANTALYA
<sehir>ARDAHAN
<sehir>ARTVIN
<sehir>AYDIN
<sehir>BALIKESIR
<sehir>BARTIN
<sehir>BATMAN
<sehir>BAYBURT
<sehir>BILECIK
<sehir>BINGOL
<sehir>BITLIS
<sehir>BOLU
<sehir>BURDUR
<sehir>BURSA
<sehir>CANAKKALE
<sehir>CANKIRI
<sehir>CORUM
<sehir>DENIZLI
<sehir>DIYARBAKIR
<sehir>DUZCE
<sehir>EDIRNE
<sehir>ELAZIG
<sehir>ERZINCAN
<sehir>ERZURUM
<sehir>ESKISEHIR
<sehir>GAZIANTEP
<sehir>GIRESUN
<sehir>GUMUSHANE
<sehir>HAKKARI
<sehir>HATAY
<sehir>IGDIR
<sehir>ISPARTA
<sehir>IZMIR
<sehir>KAHRAMANMARAS
<sehir>KARABUK
<sehir>KARAMAN
<sehir>KARS
<sehir>KASTAMONU
<sehir>KAYSERI
<sehir>KILIS
<sehir>KIRIKKALE
<sehir>KIRKLARELI
<sehir>KIRSEHIR
<sehir>KOCAELI
<sehir>KONYA
<sehir>KUTAHYA
<sehir>MALATYA
<sehir>MANISA
<sehir>MARDIN
<sehir>MERSIN
<sehir>MUGLA
<sehir>MUS
<sehir>NEVSEHIR
<sehir>NIGDE
<sehir>ORDU
<sehir>OSMANIYE
<sehir>RIZE
<sehir>SAKARYA
<sehir>SAMSUN
<sehir>SANLIURFA
<sehir>SIIRT
<sehir>SINOP
<sehir>SIRNAK
<sehir>SIVAS
<sehir>TEKIRDAG
<sehir>TOKAT
<sehir>TRABZON
<sehir>TUNCELI
<sehir>USAK
<sehir>VAN
<sehir>YALOVA
<sehir>YOZGAT
<sehir>ZONGULDAK
Posted 29-Dec-12 11:05am
ct_12419
Comments
Mika Wendelius 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 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 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 30-Dec-12 8:09am
   
5'ed!
Mika Wendelius 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
Jochen Arndt 1,975
ppolymorphe 1,920


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 29 Dec 2012
Copyright © CodeProject, 1999-2017
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