Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> simplexml_load_file() a tag <1></1>
pampper
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 27.09.2007

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


Witam,

mam problem z prasowaniem pliku xml. Ładuję plik xml za pomocą simplexml_load_file(). W pliku xml znajduje się fragment:

  1. <zdjecia>
  2. <1>true</1>
  3. <2>true</2>
  4. <3>true</3>
  5. <4>true</4>
  6. <5>true</5>
  7. <6>true</6>
  8. <7>true</7>
  9. <8>true</8>
  10. <9>true</9>
  11. <10>true</10>
  12. <11>true</11>
  13. <12>true</12>
  14. <13>true</13>
  15. <14>true</14>
  16. <15>true</15>
  17. </zdjecia>


odpalając skrypt wywala mi error:

Warning: simplexml_load_file() [function.simplexml-load-file]: ./dane.xml:10: parser error : StartTag: invalid element name in /www/skrypt.php on line 15
Warning: simplexml_load_file() [function.simplexml-load-file]: <1></1> in /www/skrypt.php on line 15
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /www/skrypt.php on line 15
Warning: simplexml_load_file() [function.simplexml-load-file]: ./dane.xml:10: parser error : expected '>' in /www/skrypt.php on line 15
Warning: simplexml_load_file() [function.simplexml-load-file]: <1></1> in /www/skrypt.php on line 15
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /www/skrypt.php on line 15

skrypt.php on line 15 - to funkcja simplexml_load_file()

Kiedy natomiast z pliku xml wywalę ten fragment to skrypt działa poprawnie. Rozumiem, że chodzi tutaj o tagi <1></1> itd. bo jak zamieniłem na na <z1></z1> itd. to również chodziło dobrze.

Jak mogę rozwiązać ten problem, żeby odczytywał tagi <1></1> a nie wywalał error.
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: 22.08.2025 - 13:47