o zaman sadece özelliğe göre seçmiş olursun. Bende hep öyle kullanıyordum. Şimdide loadstringli li öğrenmiş olduk.
Ben böyle yaptım xml dosyası doğru olmayabilir.Ordaki arraya a göre oluşturdum.
dosya.xml
<?xml version="1.0" encoding="windows-1254" ?>
<veri>
<item>
<title>titlecik</title>
<description>tanımcik</description>
<link>linkick</link>
<enclosure url="url adresi" type="tipi flashmi ne ise iste" length="uzunlugu" />
</item>
</veri>Buda php kodumuz:
<?php
$xmldosyasi = file_get_contents('dosya.xml');
$ayristir = new SimpleXMLElement($xmldosyasi);
$res = $ayristir->xpath("//item");
foreach($res as $r){
echo $r->title."<br />";
echo $r->description."<br />";
echo $r->enclosure->attributes()->url."<br />";
echo $r->enclosure->attributes()->type."<br />";
echo $r->enclosure->attributes()->length."<br />";
echo "<br />------------------------<br />";
}
?>Ben şu an bu şekil anladım.eğer başka şekilde ise, onuda elimden geldiğince yapmaya çalışırım.