Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> xml->childNodes
ljmedia
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 18.04.2005

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


witam forumowiczów

czy jest jakas funkcja zracająca ilosc węzłów w pliku xml np :
  1. <root>
  2. <wezel />
  3. <wezel />
  4. .......
  5. <wezel />
  6. </root>


i teraz aby wyciągnąć ilość wystąpienia <wezel /> ( nie moge znaleźc takiej funkcji (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) )
moze smiesznie porównam ale we flashu robie poprostu

var ile = root.firstChild.childNodes.length i mam ilosc (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) , gdzie root jest obiektem XML

pozdrawiam ljmedia
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
dasko
post
Post #2





Grupa: Zarejestrowani
Postów: 179
Pomógł: 0
Dołączył: 9.11.2004

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


Tutaj powinno też takie cuś działać:
Kod
var xml = document.implementation.createDocument("", "", null);
xml.load('jakistamplik.xml');
var ile = xml.documentElement.childNodes.length; // ilosc

(IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
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: 23.08.2025 - 16:11