Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js/xml] problem z parsowaniem
fx69
post 7.01.2007, 18:19:33
Post #1





Grupa: Zarejestrowani
Postów: 40
Pomógł: 0
Dołączył: 8.10.2006
Skąd: świat astralny

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


oto wycinek pliku xml:
  1.  
  2. <records>
  3. <record class="ciemny">
  4. <id_faktury>9</id_faktury>
  5. <nazwa>wartosci net/bru/det</nazwa>
  6. <data_dodania>21.12.2006</data_dodania>
  7. </record>
  8. <record class="jasny">
  9. <id_faktury>8</id_faktury>
  10. <nazwa>test nr 3</nazwa>
  11. <data_dodania>16.12.2006</data_dodania>
  12. </record>
  13. </records>


i funkcja js:

  1. <?php
  2. /...
  3. = $("dataTable");
  4. for (= d.rows.length-1; i >= 0; i--)
  5. d.deleteRow(i);
  6. record = xml.getElementsByTagName("record");
  7. result = "";
  8. for (= 0; i < record.length; i++) {
  9. tr = document.createElement("tr");
  10. td = document.createElement("td");
  11. td.innerHTML = startId + i; //== L.p.
  12. tr.appendChild(td);
  13. for (= 0; j < 4; j++) {  //3 kolumny z danymi
  14. td = document.createElement("td");
  15. td.innerHTML = record[i].childNodes[j].childNodes[0].NodeValue;
  16. tr.appendChild(td);
  17. }
  18. d.appendChild(tr);
  19. }
  20. return result;
  21. //...
  22. ?>


problem polega na tym, ze js tego xml'a nie chce przemielic i wyswietlic dry.gif
gdzie moze tkwic blad ?

Ten post edytował fx69 8.01.2007, 00:31:58
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 14:38