Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Simple XML
kajzur
post
Post #1





Grupa: Zarejestrowani
Postów: 385
Pomógł: 26
Dołączył: 22.03.2008
Skąd: TM

Ostrzeżenie: (0%)
-----


Witam,

Mam taki oto pliczek xml:
  1. <?xml version="1.0" encoding="ISO-8859-2"?>
  2. <zloteMysli>
  3.      <categories>
  4.            <category name="2. Psychologia w praktyce" idref="1" />
  5.            <category name="5. Zdrowie i uroda" idref="2" />
  6.            <category name="1. Praktyczna edukacja" idref="3" />
  7.            <category name="Zatrudnienie i kariera" idref="4" />
  8.            <category name="Zarabianie w Internecie" idref="5" />
  9.            <category name="3. Biznes i praca" idref="6" />
  10.            <category name="6. Pozostałe" idref="7" />
  11.            <category name="Darmowe ebooki" idref="8" />
  12.            <category name="Języki obce" idref="9" />
  13.            <category name="Szybkie czytanie i nauka" idref="10" />
  14.            <category name="Sztuka pisania" idref="11" />
  15.            <category name="Motywacja i sukces" idref="12" />
  16.            <category name="Wywieranie wpływu" idref="13" />
  17.            <category name="Relacje międzyludzkie" idref="14" />
  18.            <category name="4. Komputery i Internet" idref="15" />
  19.            <category name="Programowanie" idref="16" />
  20.            <category name="Własna firma" idref="17" />
  21.            <category name="Giełda, inwestycje" idref="18" />
  22.            <category name="Sprzedaż bezpośrednia" idref="19" />
  23.            <category name="Seks i ciąża" idref="20" />
  24.            <category name="Zdrowie dzieci" idref="21" />
  25.            <category name="Zdrowe odżywianie" idref="22" />
  26.            <category name="Ciało i duch" idref="23" />
  27.            <category name="Medycyna (także alternatywna)" idref="24" />
  28.            <category name="Rozwój osobisty" idref="25" />
  29.            <category name="Ezoteryka" idref="26" />
  30.            <category name="Gotowanie" idref="27" />
  31.            <category name="Motoryzacja" idref="28" />
  32.            <category name="Prawo &quot;po ludzku&quot;" idref="29" />
  33.            <category name="Dla majsterkowiczów" idref="30" />
  34.            <category name="Muzyka" idref="31" />
  35.            <category name="Powieści i opowiadania" idref="32" />
  36.            <category name="Zakłady bukmacherskie, hazard" idref="33" />
  37.            <category name="Studia" idref="34" />
  38.            <category name="Wychowanie dzieci" idref="35" />
  39.            <category name="Prawo" idref="36" />
  40.            <category name="Nauka angielskiego" idref="37" />
  41.            <category name="Dla dorosłych" idref="38" />
  42.            <category name="Programy" idref="39" />
  43.      </categories>
  44.      <ebooks>
  45.            <ebook idref="1">
  46.                  <category idref=""/>
  47.                  <author></author>
  48.                  <title></title>
  49.                  <shortdescription></shortdescription>
  50.                  <description></description>
  51.                  <price></price>
  52.                  <printed_price></printed_price>
  53.                  <targetprice></targetprice>
  54.                  <pricestep></pricestep>
  55.                  <isbn></isbn>
  56.                  <pages></pages>
  57.                  <status></status>
  58.                  <domain></domain>
  59.                  <printed_version></printed_version>
  60.                  <covers>
  61.                        <cover type="3d_small"/>
  62.                        <cover type="3d"/>
  63.                        <cover type="2d_small"/>
  64.                        <cover type="2d"/>
  65.                  </covers>
  66.            </ebook>
  67.      </ebooks>
  68. </zloteMysli>


Jak ja mam to jakoś normalnie wyświetlić? Mam taki kod:

  1. <?php
  2. $zloteMysli = simplexml_load_file('http://partnertools.zlotemysli.pl/?c=ebooks_xml&t=bestweek');
  3.  
  4. echo $zloteMysli->categories->name;
  5.  
  6.  
  7.     foreach($zloteMysli -> categories as $klient){
  8.      echo 'Ebook: '.$klient -> name.'';
  9.      echo '<br/>';
  10.    
  11.      echo '<hr/>';
  12.  
  13. }
  14. ?>

Ale pusta stronka jest, kurcze, nie wiem jak, pomoże ktoś?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.12.2025 - 22:32