Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [xml] problem z pobieraniem czesci danych
terabit
post
Post #1





Grupa: Zarejestrowani
Postów: 170
Pomógł: 4
Dołączył: 11.08.2006

Ostrzeżenie: (10%)
X----


Witam,

mam taki kod:
  1.  
  2. <odds_list>
  3.  
  4. <sport id="1000093178" name="Cricket" main_group_id="1000093178">
  5. <pool id="1000093838" name="The Ashes - Series" main_group_id="1"></pool>
  6. </sport>
  7.  
  8. <sport id="1000093178" name="Golf" main_group_id="2">
  9. <pool id="1000093838" name="The Ashes - Series" main_group_id="2"></pool>
  10. <pool id="1000093838" name="The Ashes - Series" main_group_id="2"></pool>
  11. <pool id="1000093838" name="The Ashes - Series" main_group_id="2"></pool>
  12. <pool id="1000093838" name="The Ashes - Series" main_group_id="2"></pool>
  13. </sport>
  14.  
  15. <sport id="1000093178" name="Pilka" main_group_id="3">
  16. <pool id="1000093838" name="The Ashes - Series" main_group_id="3"></pool>
  17. <pool id="1000093838" name="The Ashes - Series" main_group_id="3"></pool>
  18. <pool id="1000093838" name="The Ashes - Series" main_group_id="3"></pool>
  19. <pool id="1000093838" name="The Ashes - Series" main_group_id="3"></pool>
  20. </sport>
  21.  
  22. </odds_list>
  23.  


i teraz z pobieraniem tytulow, id (pilka, golf, crickiet) w SimpleXML nie ma problemu...

jednak chce najpierw pobrac tytul a poniez pod nim wyswietlic wszystkie wartosci name z pól "pool"

ma to mnie-wiecej tak wygldac:

Cricket:
-The Ashes - Series

Golf:
-The Ashes - Series
-The Ashes - Series
-The Ashes - Series
-The Ashes - Series

itd...


problem w tym ze nie wiem jak mam te elementy pobrac wedlog main_group_id...

pomoze ktos? (IMG:style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
skowron-line
post
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


xpath pobierasz wszystkie"sport" a poźniej w pętli znów xpath i pobierasz pool z i id takie jak miał sport.
Go to the top of the page
+Quote Post
terabit
post
Post #3





Grupa: Zarejestrowani
Postów: 170
Pomógł: 4
Dołączył: 11.08.2006

Ostrzeżenie: (10%)
X----


zaczalem z xpath kombinowac i znow inny problem,
juz zdazylem tutaj zapytac - Temat: xmlxpath nie wczytuje pliku z zewnatrz (IMG:style_emoticons/default/winksmiley.jpg)

Ten post edytował terabit 12.06.2010, 18:23:54
Go to the top of the page
+Quote Post

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: 24.08.2025 - 00:21