Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> XML Problem z tagiem..., XML Problem z tagiem...
Ardo
post 13.12.2011, 17:41:26
Post #1





Grupa: Zarejestrowani
Postów: 88
Pomógł: 0
Dołączył: 16.03.2008

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


Jak można pobrac dane z xml

kożytam z
  1. $product = simplexml_load_file ($hurtownia[0]);

Niestety wyskakuje błąd przy zaciąganiu danych:
Warning: simplexml_load_file() [function.simplexml-load-file]: ofertyZip/dane.xml:54: parser error : StartTag: invalid element name In
Warning: simplexml_load_file() [function.simplexml-load-file]: <1>true</1> in ...
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in ...
Warning: simplexml_load_file() [function.simplexml-load-file]: ofertyZip/dane.xml:54: parser error : expected '>' in
Warning: simplexml_load_file() [function.simplexml-load-file]: ofertyZip/dane.xml:54: parser error : Opening and ending tag mismatch: zdjecia line 53 and unparseable in

wers 53 w XML to:
  1. <record>
  2. <zdjecia>
  3. <1>true</1>
  4. <2>true</2>
  5. <3>true</3>
  6. <4>true</4>
  7. <5>false</5>
  8. <6>false</6>
  9. <7>false</7>
  10. <8>false</8>
  11. <9>false</9>
  12. <10>false</10>
  13. <11>false</11>
  14. <12>false</12>
  15. <13>false</13>
  16. <14>false</14>
  17. <15>false</15>
  18. </zdjecia>
  19. </record>


W jaki sposób można zaciągnąć dane, bo na tym Tagu się pobieranie wywala. Proszę o pomoc jak to można zaciągnąć.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
skowron-line
post 13.12.2011, 23:41:42
Post #2





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

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


1. pobierasz dane z pliku file_get_contents
2. zamieniasz <1> na dowolną poprawną nazwę, i </1>
3. simplexml_load_string

w tą stronę kombinuj.


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
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 - 19:56