Le TodayGame.XML

If you need help building your website, this is the place to hang out. If you're an HTML, PHP, Perl or web database geek, check it out. / Si vous avez besoin d'aide pour construire votre site web, c'est le forum à regarder! Si vous êtes un expert en HTML, PHP, Perl ou en base de données, c'est le forum pour vous!
Post Reply
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Le TodayGame.XML

Post by LHDC_Bob »

Salut

J'essaie de lire le fichier TodayGame.XML en utilisant la fonction simplexml_load_file.

Ca me donne un message d'erreur : Premature end of data in tag ca me donne cela à la première ligne qu'il y a un gardien
Exemple :
<VisitorTeamGoaler>
Miikka Kiprusoff (CAL), 32 saves from 37 shots - (0.865), L, 1-2-0, 60:00 minutes
<br />
</VisitorTeamGoaler>
Ca m'Indique que le <br/> est la cause de l'erreur.

J'utilise la dernière version du simulateur

Quelqu'un a une idée ?
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Re: Le TodayGame.XML

Post by LHDC_Bob »

Voici le message d'erreur qui m'apparait :

Warning: ./An3/XML/LHDC2-TodayGame.xml:10: parser error : Premature end of data in tag HomeTeamGoaler line 10 in /home/www/dombor8.100webspace.net/inc/fncaffichage.php on line 196

Warning: aler>Unknown Goalie (HAR), 46 saves from 54 shots - (0.852), 49:54 minutes
in /home/www/dombor8.100webspace.net/inc/fncaffichage.php on line 196
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14776
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: Le TodayGame.XML

Post by SimonT »

La fonction fonction simplexml_load_file??
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Re: Le TodayGame.XML

Post by LHDC_Bob »

Je comprends pas trop ta question, mais bon, c'est ma ligne de code qui ouvre le fichier XML

$xmlgame = simplexml_load_file("./An3/XML/LHDC2-TodayGame.xml")

Ca fonctionne pour les autres XML du STHS(goalies, players, transactions...)
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Re: Le TodayGame.XML

Post by LHDC_Bob »

L'erreur semble venir de la :
<HomeTeamGoaler>Unknown Goalie (HAR), 46 saves from 54 shots - (0.852), 49:54 minutes<br /> (HAR), 1 saves from 5 shots - (0.200), L, 0-1-0, 10:06 minutes<br /></HomeTeamGoaler>

Quand il y a 2 gardiens unknown dans le farm et qui sont changés parce qu'ils sont définitevement trop faibles, ca semble causer un problème.

J'ai fait un autre test en ouvrant le fichier avec un fread et en affichant les valeurs lues avec print_r
ca bloque la aussi :
Array ( [tag] => HOMETEAMGOALER [type] => open [level] => 3 [value] => Unknown Goalie (HAR), 46 saves from 54 shots - (0.852), 49:54 minutes ) [103] => Array ( [tag] => BR [type] => complete [level] => 4 ) )


Pour l'instant, je vais forcer a faire leur lignes du farm, ca devrait regler mon trouble, cependant ca reste bizarre.
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Re: Le TodayGame.XML

Post by LHDC_Bob »

J'ai fait un dernier test qui est assez concluant.

J'ai été joué dans mon fichier XML. Dans la balise du gardien j'ai ajouté un nom devant mon gardien remplacé qui n'a pas de nom et ca fonctionne.
Donc la ligne <HomeTeamGoaler>Unknown Goalie (HAR), 46 saves from 54 shots - (0.852), 49:54 minutes<br /> (HAR), 1 saves from 5 shots - (0.200), L, 0-1-0, 10:06 minutes<br /></HomeTeamGoaler>
est devenue :
<HomeTeamGoaler>Unknown Goalie (HAR), 46 saves from 54 shots - (0.852), 49:54 minutes<br />UNKNOWN ENCORE(HAR), 1 saves from 5 shots - (0.200), L, 0-1-0, 10:06 minutes<br /></HomeTeamGoaler>

Maintenant la lecture avec fread et la lecture avec simple_xml_load fonctionne

J'ai aussi fait un test en enlevant l'espace entre le <br /> et le (HAR) dans le fichier XML et ca aussi ca fonctionne.

Je ne sais pas si on peut considérer ca comme un bug.
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14776
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: Le TodayGame.XML

Post by SimonT »

Ma question est plutot pourquoi il n'y pas de nom de gardien écrit. C'est ça qui cause de ton bug et ça ne devrait pas arrivé. Est-tu capable de recréé ce bug?
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Re: Le TodayGame.XML

Post by LHDC_Bob »

Surement que je peux recréer le problème.

Juste avoir un farm boosté contre un farm qui a pas un fichu joueur et surtout aucun gardien d'habillé.
Quand le Unknown goalie se fait remplacer par un autre Unknown goalie,c'Est alors la que ca cause ce problème

Le problème en fait, c'est que j'ai quelque DG trop paresseux pour faire leurs lignes du farm.
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14776
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: Le TodayGame.XML

Post by SimonT »

J'essaye de recrée le problème mais pas capable. Quand ton fichier XML est corrumptu, ton fichier HTML l'est aussi! Il manque le Unknown Goalie sur le HTML aussi?
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
LHDC_Bob
The Accomplished One / L'Accompli
Posts: 139
Joined: Wed Mar 07, 2007 9:51 am

Re: Le TodayGame.XML

Post by LHDC_Bob »

Le deuxième gardien ne semble pas apparaître quand c'est un Unknown

http://lhsdc.dominicborduas.com/An3/LHD ... Games.html
Springfield Falcons

4
Rob Niedermayer(3), Unknown Player(1), Andre Roy(1), Nikita Alexeev(3)

Karri Ramo (SPR), 23 saves from 30 shots - (0.767), L, 3-3-0, 50:30 minutes
(SPR), 0 saves from 5 shots - (0.000), 9:30 minutes


Voici le code source : <tbody><tr><td class="STHSTodayGame_TeamName" width="90%"><h3>Springfield Falcons</h3></td><td class="STHSTodayGame_TeamScore" width="10%"><h3>4</h3></td></tr><tr><td colspan="2" class="STHSTodayGame_TeamNote">
Rob Niedermayer(3), Unknown Player(1), Andre Roy(1), Nikita Alexeev(3)<br><br>
Karri Ramo (SPR), 23 saves from 30 shots - (0.767), L, 3-3-0, 50:30 minutes<br> (SPR), 0 saves from 5 shots - (0.000), 9:30 minutes<br><br></td></tr>
<tr><td class="STHSTodayGame_TeamName" width="90%"><h3>Milwaukee Admirals</h3></td><td class="STHSTodayGame_TeamScore" width="10%"><h3><font color="red">12</font></h3></td></tr><tr><td colspan="2" class="STHSTodayGame_TeamNote">Brian Gionta(1,2), Alexander Radulov(1,2), Ryan Suter(1), Steve Sullivan(1), David Backes(1,2), Vernon Fiddler(1), Scottie Upshall(7,8,9)<br><br>
Josh Harding (MIL), 29 saves from 33 shots - (0.879), W, 1-0-0, 60:00 minutes<br><br></td></tr></tbody>


Le problème semble venir de l'espace avec le <br> (ce que j'ai mis en gras)

Et j'ai encore le problème quand j'essaie de loader le fichier TodayGame.xml.
VOici mes lignes de Warning:
Warning: simplexml_load_file() [function.simplexml-load-file]: ./An3/XML/LHDC2-TodayGame.xml:8: parser error : Premature end of data in tag VisitorTeamGoaler line 8 in

Warning: simplexml_load_file() [function.simplexml-load-file]: arri Ramo (SPR), 23 saves from 30 shots - (0.767), L, 3-3-0, 50:30 minutes<br /> in

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /


Je me demande comment mon fichier peut être corrompu s'il provient directement du simulateur.
Post Reply