{ } array(0) ... hatası veriyor hocam
tam olarak:
xml dosyası burada:
www.xx.xml
php dosyamın içeriği de bu şekilde.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>remixon stok güncelleme</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" charset='UTF-8'>
<script type="text/javascript">
function exportExcel() {
var tableExport = document.getElementById('tableExport');
var html = tableExport.outerHTML;
while (html.indexOf('ç') != -1) html = html.replace('ç', 'ç');
while (html.indexOf('ğ') != -1) html = html.replace('ğ', 'ğ');
while (html.indexOf('ı') != -1) html = html.replace('ı', 'ı');
while (html.indexOf('ö') != -1) html = html.replace('ö', 'ö');
while (html.indexOf('ş') != -1) html = html.replace('ş', 'ş');
while (html.indexOf('ü') != -1) html = html.replace('ü', 'ü');
while (html.indexOf('Ç') != -1) html = html.replace('Ç', 'Ç');
while (html.indexOf('Ğ') != -1) html = html.replace('Ğ', 'Ğ');
while (html.indexOf('İ') != -1) html = html.replace('İ', 'İ');
while (html.indexOf('Ö') != -1) html = html.replace('Ö', 'Ö');
while (html.indexOf('Ş') != -1) html = html.replace('Ş', 'Ş');
while (html.indexOf('Ü') != -1) html = html.replace('Ü', 'Ü');
window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html));
}
</script>
<script>
function myFunction() {
alert("hazırlanıyor");
}
</script>
</head>
<body>
<button id="btnExport" onclick="exportExcel();">excele aktar</button> - <button id="" onclick="myFunction()"> gönder</button>
<?
$IceriklerXML = simplexml_load_file("http://www.remixon.com.tr/remixon.xml");
echo "<table id='tableExport' width='200' border='1'>";
echo "<tr>";
echo "<td>islem_tipi</td>";
echo "<td>urun_kod</td>";
echo "<td>stok_kodu</td>";
echo "<td>ops_kodu_1</td>";
echo "<td>ops_tanimi_1</td>";
echo "<td>ops_kodu_2</td>";
echo "<td>ops_tanimi_2</td>";
echo "<td>barkod</td>";
echo "<td>entegrasyon_kod</td>";
echo "<td>ops_durum</td>";
echo "<td>ops_stok_miktari</td>";
echo " </tr>";
foreach ($IceriklerXML->urun as $urun)
{
var_dump($urun->xpath('Secenek'));
echo "<tr>";
echo "<td>G</td>";
echo "<td>24-".$urun->UrunKodu;"</td>";
echo "<td>".$urun->UrunSecenek->Secenek->StokKodu;"</td>";
echo "<td></td>";
echo "<td>" .$urun->UrunSecenek->Secenek->EkSecenekOzellik->OzellikKodu. "" .$urun->UrunSecenek->Secenek->EkSecenekOzellik->OzellikDegeri; "</td>";
echo "<td>ops_tanimi_1</td>";
echo "<td>ops_kodu_2</td>";
echo "<td>ops_tanimi_2</td>";
echo "<td>barkod</td>";
echo "<td>entegrasyon_kod</td>";
echo "<td>ops_durum</td>";
echo "<td>ops_stok_miktari</td>";
echo " </tr>";
echo "<tr>";
echo "<td colspan='2'> </td>";
echo " <td>".$urun->UrunSecenek->Secenek-Secenek->StokKodu;"</td>";
echo " <td colspan='12'> </td>";
echo " </tr>";
}
echo "</table>";
?>