lezen in gpx file top op een bepaalde plaats

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Pagina: « vorige 1 2 3 4 volgende »

Berta Pappens

Berta Pappens

19/02/2023 09:39:12
Quote Anchor link
Ozzie het gevraagde

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0" creator="GSAK"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak:.com/cache/1/0/1 http://www.groundspeak:.com/cache/1/0/1/cache.xsd"
xmlns="http://www.topografix.com/GPX/1/0">
 <desc>Geocache file generated by GSAK</desc>
 <author>GSAK</author>
 <email>[email protected]</email>
 <time>2023-02-17T14:03:48Z</time>
 <keywords>cache, geocache, groundspeak:</keywords>
 <bounds minlat="50.53355" minlon="4.0968" maxlat="50.559167" maxlon="4.130833"/>
 <wpt lat="50.558333" lon="4.101667">
  <time>2022-12-24T08:00:00Z</time>
  <name>GCA02MB</name>
  <desc>26. Il y a de l'illusion dans l'air by Jc et Fr (2/2)</desc>
  <url>http://coord.info/GCA02MB</url>
  <urlname>26. Il y a de l'illusion dans l'air by Jc et Fr</urlname>
  <sym>Geocache</sym>
  <type>Geocache|Unknown Cache</type>
  <groundspeak:cache id="8826643" available="True" archived="False" xmlns:groundspeak:="http://www.groundspeak:.com/cache/1/0/1">
   <groundspeak:name>26. Il y a de l'illusion dans l'air</groundspeak:name>
   <groundspeak:placed_by>Jc et Fr</groundspeak:placed_by>
   <groundspeak:owner id="13158440">Jc et Fr</groundspeak:owner>
   <groundspeak:type>Unknown Cache</groundspeak:type>
   <groundspeak:container>Micro</groundspeak:container>
   <groundspeak:attributes>
     <groundspeak:attribute id="6" inc="1">Recommended for kids</groundspeak:attribute>
     <groundspeak:attribute id="9" inc="1">Significant hike</groundspeak:attribute>
     <groundspeak:attribute id="13" inc="1">Available at all times</groundspeak:attribute>
     <groundspeak:attribute id="15" inc="1">Available during winter</groundspeak:attribute>
     <groundspeak:attribute id="32" inc="1">Bicycles</groundspeak:attribute>
     <groundspeak:attribute id="41" inc="1">Stroller accessible</groundspeak:attribute>
     <groundspeak:attribute id="63" inc="1">Tourist Friendly</groundspeak:attribute>
   </groundspeak:attributes>
   <groundspeak:difficulty>2</groundspeak:difficulty>
   <groundspeak:terrain>2</groundspeak:terrain>
   <groundspeak:country>Belgium</groundspeak:country>
   <groundspeak:state>Hainaut</groundspeak:state>
   <groundspeak:short_description html="False"> </groundspeak:short_description>
Gewijzigd op 19/02/2023 09:42:14 door - Ariën -
 
PHP hulp

PHP hulp

27/05/2026 11:29:47
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 09:42:58
Quote Anchor link
Zo te zien mis je nog een deel.
Voor het gemak heb ik dit tussen code-tags geplaatst. Voortaan graag zelf doen aub.
Gewijzigd op 19/02/2023 09:45:06 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 09:45:34
Quote Anchor link
ja enkel het einde, de vraag van ozzie was max 25 regels
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 09:48:43
Quote Anchor link
Ongeveer....
We willen wel wat volledigs maar beknopts zien. Dus als er bij wijze van spreken 53 items in staan, gelieve dit te beperken tot 2 stuks ofzo.
 
Berta Pappens

Berta Pappens

19/02/2023 09:48:52
Quote Anchor link
- Ariën - op 19/02/2023 08:57:47:
Ikzelf gebruik geloof zo een constructie:

$string= file_get_content("bla.xml") waarna ik $xml=simplexml_load_string($string) gebruik.

Als je nu een beknopte sample op Pastebin plaatst met een paar geocache items. Met een half deel kunnen we niet veel als we niet weten welke tags (nodes) er gebruikt worden.


Parse error: syntax error, unexpected token ":", expecting "," or ";" in C:\xampp\htdocs\geo_db_gpx_gsak\test.php on line 11

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
header ('Content-type: text/html; charset=utf8mb4');
$string=file_get_content("c:/geo_db/test.gpx");
$xml=simplexml_load_file($string) or die("Error: Cannot create object");
//var_dump($xml->wpt[0]);
echo $xml->wpt[0]['lat'] . "<br>";
echo $xml->wpt[0]['lon'] . "<br>";
echo $xml->wpt[0]->name . "<br>";
echo $xml->wpt[0]->desc . "<br>";
echo $xml->wpt[0]->type . "<br>";
echo $xml->wpt[0]->groundspeak:container . "<br>";
echo $xml->wpt[0]->groundspeak:difficulty . "<br>";
echo $xml->wpt[0]->groundspeak:terrain . "<br>";
echo $xml->wpt[0]->groundspeak:country . "<br>";
echo $xml->wpt[0]->groundspeak:state . "<br>";
?>


Blijkbaar is het met dit ook niet te eenvoudig om een gpx uit te lezen ...



Toevoeging op 19/02/2023 09:50:40:

Ariën hier zijn 2 stuks
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0" creator="GSAK"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak:.com/cache/1/0/1 http://www.groundspeak:.com/cache/1/0/1/cache.xsd"
xmlns="http://www.topografix.com/GPX/1/0">
 <desc>Geocache file generated by GSAK</desc>
 <author>GSAK</author>
 <email>[email protected]</email>
 <time>2023-02-17T14:03:48Z</time>
 <keywords>cache, geocache, groundspeak:</keywords>
 <bounds minlat="50.53355" minlon="4.0968" maxlat="50.559167" maxlon="4.130833"/>
 <wpt lat="50.558333" lon="4.101667">
  <time>2022-12-24T08:00:00Z</time>
  <name>GCA02MB</name>
  <desc>26. Il y a de l'illusion dans l'air by Jc et Fr (2/2)</desc>
  <url>http://coord.info/GCA02MB</url>
  <urlname>26. Il y a de l'illusion dans l'air by Jc et Fr</urlname>
  <sym>Geocache</sym>
  <type>Geocache|Unknown Cache</type>
  <groundspeak:cache id="8826643" available="True" archived="False" xmlns:groundspeak:="http://www.groundspeak:.com/cache/1/0/1">
   <groundspeak:name>26. Il y a de l'illusion dans l'air</groundspeak:name>
   <groundspeak:placed_by>Jc et Fr</groundspeak:placed_by>
   <groundspeak:owner id="13158440">Jc et Fr</groundspeak:owner>
   <groundspeak:type>Unknown Cache</groundspeak:type>
   <groundspeak:container>Micro</groundspeak:container>
   <groundspeak:attributes>
     <groundspeak:attribute id="6" inc="1">Recommended for kids</groundspeak:attribute>
     <groundspeak:attribute id="9" inc="1">Significant hike</groundspeak:attribute>
     <groundspeak:attribute id="13" inc="1">Available at all times</groundspeak:attribute>
     <groundspeak:attribute id="15" inc="1">Available during winter</groundspeak:attribute>
     <groundspeak:attribute id="32" inc="1">Bicycles</groundspeak:attribute>
     <groundspeak:attribute id="41" inc="1">Stroller accessible</groundspeak:attribute>
     <groundspeak:attribute id="63" inc="1">Tourist Friendly</groundspeak:attribute>
   </groundspeak:attributes>
   <groundspeak:difficulty>2</groundspeak:difficulty>
   <groundspeak:terrain>2</groundspeak:terrain>
   <groundspeak:country>Belgium</groundspeak:country>
   <groundspeak:state>Hainaut</groundspeak:state>
   <groundspeak:short_description html="False"> </groundspeak:short_description>
   <groundspeak:long_description html="True">&lt;p style="text-align:center;"&gt;&lt;img src="https://img.geocaching.com:443/8e0188ec-8fe0-4a56-a109-6d2326125bcf.png" /&gt;&lt;/p&gt;

&lt;p&gt;Cette cache fait partie d'une s��rie de 41 myst��res qui vous emm��neront faire une balade de &lt;span style="color:#2ecc71;"&gt;+/- 8 kms �� vol d'oiseau.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Elle est��r��alisable �� pieds, �� v��lo ou avec des poussettes, moiti�� sur routes moyennement fr��quent��es (sauf un petit tron��on plus dangereux) et moiti�� sur chemins de terre parfois assez caillouteux mais sans grandes difficult��s au niveau des d��nivel��s.&lt;/p&gt;

&lt;p&gt;&lt;span style="color:#e74c3c;"&gt;N���oubliez pas votre canne �� p��che, vous en aurez besoin �� 8 reprises.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Vous pouvez commencer la balade o�� vous voulez puisqu'il n'y a pas de bonus.&lt;/p&gt;

&lt;p&gt;La difficult�� indiqu��e en haut de la page��est celle que vous rencontrerez sur place.&lt;/p&gt;

&lt;p&gt;La difficult�� de la r��solution de cette cache-ci est du niveau 2.&lt;/p&gt;

&lt;p&gt;Au niveau du��d��codage, vous devrez faire des puzzles de maximum 70 pi��ces au bout desquels vous devrez ��tre attentifs aux messages qui apparaitront car��ils vous donneront des indications sur la suite des r��jouissances.��&lt;img alt="wink" height="23" src="https://cdn.ckeditor.com/4.13.0/full-all/plugins/smiley/images/wink_smile.png" title="wink" width="23" /&gt;&lt;/p&gt;

&lt;p&gt;Soit��une question vous sera pos��e et��la r��ponse devra ��tre entr��e��dans un checker certitude.��&lt;span style="color:#e74c3c;"&gt;Si elle comprend plusieurs parties, les mots��devront ��tre ��crits en majuscules, sans accents, les nombres en chiffres et toutes les parties devront����tre coll��es��ensemble.&lt;/span&gt; Une bonne r��ponse entrainera la r��ception des coordonn��es nord ou est de la boite finale. Conservez-les.&lt;/p&gt;

&lt;p&gt;Soit vous devrez encore d��couvrir les coordonn��es.��Comme elles seront en deux parties (nord et est), il faudra aussi��les conserver pour les entrer ensemble dans le checker.&lt;/p&gt;

&lt;p&gt;Bon amusement !&lt;/p&gt;

&lt;p&gt;��&lt;/p&gt;

&lt;p&gt;Pour r��aliser le premier puzzle, cliquez sur le lien��suivant :&lt;/p&gt;

&lt;p&gt;��&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.jigidi.com/solve/3aojqm5h/26-a/"&gt;&lt;img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.certitudes.org/certitude?wp=W1A02MB"&gt;&lt;img src="https://www.certitudes.org/logo?wp=W1A02MB" title="Cliquer pour voir la liste des utilisateurs ayant r��solu l'��nigme" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-family:Comic Sans MS;"&gt;Vous pouvez valider votre solution d'��nigme avec &lt;a href="https://www.certitudes.org/certitude?wp=W1A02MB"&gt;certitude&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;��&lt;/p&gt;

&lt;p&gt;Pour r��aliser le second puzzle, cliquez sur le lien��suivant :&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.jigidi.com/solve/gr8k5yxw/26-b/"&gt;&lt;img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.certitudes.org/certitude?wp=W2A02MB"&gt;&lt;img src="https://www.certitudes.org/logo?wp=W2A02MB" title="Cliquer pour voir la liste des utilisateurs ayant r��solu l'��nigme" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-family:Comic Sans MS;"&gt;Vous pouvez valider votre solution d'��nigme avec &lt;a href="https://www.certitudes.org/certitude?wp=W2A02MB"&gt;certitude&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;</groundspeak:long_description>
    <groundspeak:encoded_hints></groundspeak:encoded_hints>
   <groundspeak:logs>
  </groundspeak:logs>
   <groundspeak:travelbugs>
   </groundspeak:travelbugs>
</groundspeak:cache>
</wpt>
 <wpt lat="50.559167" lon="4.1025">
  <time>2022-12-24T08:00:00Z</time>
  <name>GCA02MK</name>
  <desc>28. Il y a de l'illusion dans l'air by Jc et Fr (2/2)</desc>
  <url>http://coord.info/GCA02MK</url>
  <urlname>28. Il y a de l'illusion dans l'air by Jc et Fr</urlname>
  <sym>Geocache</sym>
  <type>Geocache|Unknown Cache</type>
  <groundspeak:cache id="8826651" available="True" archived="False" xmlns:groundspeak:="http://www.groundspeak:.com/cache/1/0/1">
   <groundspeak:name>28. Il y a de l'illusion dans l'air</groundspeak:name>
   <groundspeak:placed_by>Jc et Fr</groundspeak:placed_by>
   <groundspeak:owner id="13158440">Jc et Fr</groundspeak:owner>
   <groundspeak:type>Unknown Cache</groundspeak:type>
   <groundspeak:container>Micro</groundspeak:container>
   <groundspeak:attributes>
     <groundspeak:attribute id="6" inc="1">Recommended for kids</groundspeak:attribute>
     <groundspeak:attribute id="9" inc="1">Significant hike</groundspeak:attribute>
     <groundspeak:attribute id="13" inc="1">Available at all times</groundspeak:attribute>
     <groundspeak:attribute id="15" inc="1">Available during winter</groundspeak:attribute>
     <groundspeak:attribute id="32" inc="1">Bicycles</groundspeak:attribute>
     <groundspeak:attribute id="41" inc="1">Stroller accessible</groundspeak:attribute>
     <groundspeak:attribute id="56" inc="1">Medium hike (1km-10km)</groundspeak:attribute>
     <groundspeak:attribute id="63" inc="1">Tourist Friendly</groundspeak:attribute>
   </groundspeak:attributes>
   <groundspeak:difficulty>2</groundspeak:difficulty>
   <groundspeak:terrain>2</groundspeak:terrain>
   <groundspeak:country>Belgium</groundspeak:country>
   <groundspeak:state>Hainaut</groundspeak:state>
   <groundspeak:short_description html="False"> </groundspeak:short_description>
   <groundspeak:long_description html="True">&lt;p style="text-align:center;"&gt;&lt;img src="https://img.geocaching.com:443/ce583082-fba5-4f1c-92fd-a8d0f2874ea1.png" /&gt;&lt;/p&gt;

&lt;p&gt;Cette cache fait partie d'une s��rie de 41 myst��res qui vous emm��neront faire une balade de &lt;span style="color:#2ecc71;"&gt;+/- 8 kms �� vol d'oiseau.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Elle est��r��alisable �� pieds, �� v��lo ou avec des poussettes, moiti�� sur routes moyennement fr��quent��es (sauf un petit tron��on plus dangereux) et moiti�� sur chemins de terre parfois assez caillouteux mais sans grandes difficult��s au niveau des d��nivel��s.&lt;/p&gt;

&lt;p&gt;&lt;span style="color:#e74c3c;"&gt;N���oubliez pas votre canne �� p��che, vous en aurez besoin �� 8 reprises.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Vous pouvez commencer la balade o�� vous voulez puisqu'il n'y a pas de bonus.&lt;/p&gt;

&lt;p&gt;La difficult�� indiqu��e en haut de la page��est celle que vous rencontrerez sur place.&lt;/p&gt;

&lt;p&gt;La difficult�� de la r��solution de cette cache-ci est du niveau 2.&lt;/p&gt;

&lt;p&gt;Au niveau du��d��codage, vous devrez faire des puzzles de maximum 70 pi��ces au bout desquels vous devrez ��tre attentifs aux messages qui apparaitront car��ils vous donneront des indications sur la suite des r��jouissances.��&lt;img alt="wink" height="23" src="https://cdn.ckeditor.com/4.13.0/full-all/plugins/smiley/images/wink_smile.png" title="wink" width="23" /&gt;&lt;/p&gt;

&lt;p&gt;Soit��une question vous sera pos��e et��la r��ponse devra ��tre entr��e��dans un checker certitude.��&lt;span style="color:#e74c3c;"&gt;Si elle comprend plusieurs parties, les mots��devront ��tre ��crits en majuscules, sans accents, les nombres en chiffres et toutes les parties devront����tre coll��es��ensemble.&lt;/span&gt; Une bonne r��ponse entrainera la r��ception des coordonn��es nord ou est de la boite finale. Conservez-les.&lt;/p&gt;

&lt;p&gt;Soit vous devrez encore d��couvrir les coordonn��es.��Comme elles seront en deux parties (nord et est), il faudra aussi��les conserver pour les entrer ensemble dans le checker.&lt;/p&gt;

&lt;p&gt;Bon amusement !&lt;/p&gt;

&lt;p&gt;��&lt;/p&gt;

&lt;p&gt;Pour r��aliser le premier puzzle, cliquez sur le lien��suivant :&lt;/p&gt;

&lt;p&gt;��&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.jigidi.com/solve/h15bo764/28-a/"&gt;&lt;img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.certitudes.org/certitude?wp=W1A02MK"&gt;&lt;img src="https://www.certitudes.org/logo?wp=W1A02MK" title="Cliquer pour voir la liste des utilisateurs ayant r��solu l'��nigme" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-family:Comic Sans MS;"&gt;Vous pouvez valider votre solution d'��nigme avec &lt;a href="https://www.certitudes.org/certitude?wp=W1A02MK"&gt;certitude&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;��&lt;/p&gt;

&lt;p&gt;Pour r��aliser le second puzzle, cliquez sur le lien��suivant :&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.jigidi.com/solve/zp88ye9u/28-b/"&gt;&lt;img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p style="text-align:center;"&gt;&lt;a href="https://www.certitudes.org/certitude?wp=W2A02MK"&gt;&lt;img src="https://www.certitudes.org/logo?wp=W2A02MK" title="Cliquer pour voir la liste des utilisateurs ayant r��solu l'��nigme" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-family:Comic Sans MS;"&gt;Vous pouvez valider votre solution d'��nigme avec &lt;a href="https://www.certitudes.org/certitude?wp=W2A02MK"&gt;certitude&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;</groundspeak:long_description>
    <groundspeak:encoded_hints></groundspeak:encoded_hints>
   <groundspeak:logs>
  </groundspeak:logs>
   <groundspeak:travelbugs>
   </groundspeak:travelbugs>
</groundspeak:cache>
</wpt>


Edit:
Gelieve voortaan [code] en [/code] tags toe te passom de script en code die je in het forum plaatst. Zie ook de opmaakcodes in de Veelgestelde Vragen.
Gewijzigd op 19/02/2023 14:35:06 door - Ariën -
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 09:52:41
Quote Anchor link
Dat op lijn 11 is een namespace:
groundspeak:container.

Toevoeging op 19/02/2023 09:54:07:

https://www.php.net/manual/en/simplexmlelement.getnamespaces.php

Kijk hier over hoe je die aanroept.
En zet je code/lap xml aub tussen codetags. We vinden het fijn als je het forum leesbaar houdt.
Gewijzigd op 19/02/2023 09:54:53 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 09:54:10
Quote Anchor link
oke maar dit moet ik kunnen lezen.
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 09:56:29
Quote Anchor link
Maar het gaat beter tussen code-tags. ..

Ik had dit al eerder gevraagd. Lees anders de Veelgestelde Vragen op deze site en lees je even in over de opmaakcodes voor in het forum.

Dus pas je bericht aan, en zet er code-tags omheen.
Gewijzigd op 19/02/2023 09:57:24 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 10:33:23
Quote Anchor link
Sorry zal er op letten.

Denk dat ik te oud ben om jullie goed te begrijpen, het gaat er ook zo vlug niet meer in .

Als ik het volgende doe krijg ik terug foutmeldingen op groundspeak :

Warning: simplexml_load_file(): c:/geo_db/test.gpx:21: namespace error : Failed to parse QName 'xmlns:groundspeak:' in C:\xampp\htdocs\geo_db_gpx_gsak\test1.php on line 4

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
<?php
header ('Content-type: text/html; charset=utf8mb4');

$xml=simplexml_load_file("c:/geo_db/test.gpx") or die("Error: Cannot create object");
$sxe=new SimpleXMLElement($xml);
$ns=$sxe->getNamespaces(true);
var_dump($ns);
?>


Blijkbaar niet eenvoudig om een gpx uit te lezen ..??? op deze manier.
Gewijzigd op 19/02/2023 14:35:42 door - Ariën -
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 14:50:10
Quote Anchor link
Ik ben er naar aan het kijken, maar die XML is zo corrupt als het maar kan zijn.
Waar heb je die vandaan?

Een error die ik krijg is dit:

The prefix "groundspeak" for element "groundspeak:cache" is not bound.


De tag </gpx> miste aan het eind.
Nu kan ik hem wel goed inladen, maar het geeft wel een berg warnings door brakke namespaces.
Gewijzigd op 19/02/2023 15:02:53 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 14:54:40
Quote Anchor link
Deze zal beter zijn.
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0" creator="GSAK"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0/1 http://www.groundspeak.com/cache/1/0/1/cache.xsd http://www.gsak.net/xmlv1/6 http://www.gsak.net/xmlv1/6/gsak.xsd"
xmlns="http://www.topografix.com/GPX/1/0">
 <desc>Geocache file generated by GSAK (HasChildren)</desc>
 <author>GSAK</author>
 <email>[email protected]</email>
 <time>2023-01-07T17:20:56Z</time>
 <keywords>cache, geocache, groundspeak</keywords>
 <bounds minlat="48.12003" minlon="6.5506" maxlat="48.1357833333333" maxlon="6.57116666666667"/>
 <wpt lat="48.135783333333336" lon="6.5531833333333331">
  <time>2021-11-01T08:00:00Z</time>
  <name>GC9B1VF</name>
  <desc>???? #21# les su��doises de la for��t de ??????? by geotrou (5/4)</desc>
  <url>http://coord.info/GC9B1VF</url>
  <urlname>???? #21# les su��doises de la for��t de ??????? by geotrou</urlname>
  <sym>Geocache</sym>
  <type>Geocache|Unknown Cache</type>
    <gsak:wptExtension xmlns:gsak="http://www.gsak.net/xmlv1/6">
      <gsak:UserFlag>false</gsak:UserFlag>
      <gsak:Lock>false</gsak:Lock>
      <gsak:DNF>false</gsak:DNF>
      <gsak:Watch>false</gsak:Watch>
      <gsak:UserData></gsak:UserData>
      <gsak:LatBeforeCorrect>48.13335</gsak:LatBeforeCorrect>
      <gsak:LonBeforeCorrect>6.53425</gsak:LonBeforeCorrect>
      <gsak:StateBeforeCorrect>Grand-Est</gsak:StateBeforeCorrect>
      <gsak:CountyBeforeCorrect></gsak:CountyBeforeCorrect>
      <gsak:FirstToFind>false</gsak:FirstToFind>
      <gsak:User2></gsak:User2>
      <gsak:User3></gsak:User3>
      <gsak:User4></gsak:User4>
      <gsak:County></gsak:County>
      <gsak:UserSort>0</gsak:UserSort>
      <gsak:SmartName>21LesSud</gsak:SmartName>
      <gsak:LastGpxDate>2023-01-07</gsak:LastGpxDate>
      <gsak:Code>GC9B1VF</gsak:Code>
      <gsak:Resolution></gsak:Resolution>
      <gsak:IsPremium>true</gsak:IsPremium>
      <gsak:FavPoints>1</gsak:FavPoints>
      <gsak:GcNote>BUBO SCANDIACUS
ist die richtige L��sung.
Die Final-Location ist:
N 48 08.147 E 006 33.191
Zusatzinfo: BRRRRRR!!!!</gsak:GcNote>
      <gsak:Guid></gsak:Guid>
      <gsak:CacheImages>
      </gsak:CacheImages>
      <gsak:LogImages>
      </gsak:LogImages>
      <gsak:CustomData>
Custom_Start:cCode:Custom_Data:GC9B1VF:Custom_End
Custom_Start:Adresse:Custom_Data::Custom_End
Custom_Start:CorOnline:Custom_Data:0:Custom_End
Custom_Start:TranslatedText:Custom_Data::Custom_End
Custom_Start:OriginalText:Custom_Data::Custom_End
Custom_Start:LabID:Custom_Data::Custom_End
Custom_Start:LabStageID:Custom_Data::Custom_End

      </gsak:CustomData>
    </gsak:wptExtension>
  <groundspeak:cache id="8230052" available="True" archived="False" xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">
   <groundspeak:name>???? #21# les su��doises de la for��t de ???????</groundspeak:name>
   <groundspeak:placed_by>geotrou</groundspeak:placed_by>
   <groundspeak:owner id="2580031">geotrou</groundspeak:owner>
   <groundspeak:type>Unknown Cache</groundspeak:type>
   <groundspeak:container>Micro</groundspeak:container>
   <groundspeak:attributes>
     <groundspeak:attribute id="40" inc="1">Stealth required</groundspeak:attribute>
     <groundspeak:attribute id="51" inc="1">Special Tool Required</groundspeak:attribute>
   </groundspeak:attributes>
   <groundspeak:difficulty>5</groundspeak:difficulty>
   <groundspeak:terrain>4</groundspeak:terrain>
   <groundspeak:country>France</groundspeak:country>
   <groundspeak:state>Grand-Est</groundspeak:state>
   <groundspeak:short_description html="False"> </groundspeak:short_description>
   <groundspeak:long_description html="True">&lt;p&gt;&lt;a href="https://www.jigidi.com/solve/yzxjccd1/21"&gt;&lt;img alt src="https://s3.amazonaws.com/gs-geo-images/d230f50b-5dd6-4992-9c07-9da3385b831f_l.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;Pour obtenir les coordonn��es de cette cache vous devez faire un petit puzzle ,&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;chercher le nom de ce qui est repr��sent�� et l'inscrire dans "Certitude"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;en lettres majuscules sans espace ni accent&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;&lt;em&gt;bonnes recherches &lt;img alt src="https://s3.amazonaws.com/gs-geo-images/2f5f2b4a-511d-41ba-bc42-0e5e59b39a10_l.jpg" /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;center&gt;&lt;a href="https://www.certitudes.org/certitude?wp=GC9B1VF"&gt;&lt;img src="https://www.certitudes.org/logo?wp=GC9B1VF" border="0" title="Cliquer pour voir la liste des utilisateurs ayant r��solu l'��nigme" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;font face="Comic Sans MS"&gt;Vous pouvez valider votre solution d'��nigme avec &lt;a href="https://www.certitudes.org/certitude?wp=GC9B1VF"&gt;certitude&lt;/a&gt;.&lt;/font&gt;&lt;/center&gt;</groundspeak:long_description>
    <groundspeak:encoded_hints></groundspeak:encoded_hints>
   <groundspeak:logs>
    <groundspeak:log id="-2">
    <groundspeak:date>2023-01-07T08:00:00</groundspeak:date>
    <groundspeak:type>Write note</groundspeak:type>
    <groundspeak:finder id="0">GSAK</groundspeak:finder>
    <groundspeak:text encoded="False">BUBO SCANDIACUS
ist die richtige L��sung.
Die Final-Location ist:
N 48 08.147 E 006 33.191
Zusatzinfo: BRRRRRR!!!!

    </groundspeak:text>
   </groundspeak:log>
  </groundspeak:logs>
   <groundspeak:travelbugs>
   </groundspeak:travelbugs>
</groundspeak:cache>
</wpt>
 <wpt lat="48.13408" lon="6.55453">
  <time>2021-11-01T08:00:00Z</time>
  <name>GC9B498</name>
  <desc>???? #22# les su��doises de la for��t de ??????? by geotrou (5/4,5)</desc>
  <url>http://coord.info/GC9B498</url>
  <urlname>???? #22# les su��doises de la for��t de ??????? by geotrou</urlname>
  <sym>Geocache</sym>
  <type>Geocache|Unknown Cache</type>
    <gsak:wptExtension xmlns:gsak="http://www.gsak.net/xmlv1/6">
      <gsak:UserFlag>false</gsak:UserFlag>
      <gsak:Lock>false</gsak:Lock>
      <gsak:DNF>false</gsak:DNF>
      <gsak:Watch>false</gsak:Watch>
      <gsak:UserData></gsak:UserData>
      <gsak:LatBeforeCorrect>48.148217</gsak:LatBeforeCorrect>
      <gsak:LonBeforeCorrect>6.535283</gsak:LonBeforeCorrect>
      <gsak:StateBeforeCorrect>Grand-Est</gsak:StateBeforeCorrect>
      <gsak:CountyBeforeCorrect></gsak:CountyBeforeCorrect>
      <gsak:FirstToFind>false</gsak:FirstToFind>
      <gsak:User2></gsak:User2>
      <gsak:User3></gsak:User3>
      <gsak:User4></gsak:User4>
      <gsak:County></gsak:County>
      <gsak:UserSort>0</gsak:UserSort>
      <gsak:SmartName>22LesSud</gsak:SmartName>
      <gsak:LastGpxDate>2023-01-07</gsak:LastGpxDate>
      <gsak:Code>GC9B498</gsak:Code>
      <gsak:Resolution></gsak:Resolution>
      <gsak:IsPremium>true</gsak:IsPremium>
      <gsak:FavPoints>2</gsak:FavPoints>
      <gsak:GcNote>son sous ordre</gsak:GcNote>
      <gsak:Guid></gsak:Guid>
      <gsak:CacheImages>
      </gsak:CacheImages>
      <gsak:LogImages>
      </gsak:LogImages>
      <gsak:CustomData>
Custom_Start:cCode:Custom_Data:GC9B498:Custom_End
Custom_Start:Adresse:Custom_Data::Custom_End
Custom_Start:CorOnline:Custom_Data:0:Custom_End
Custom_Start:TranslatedText:Custom_Data::Custom_End
Custom_Start:OriginalText:Custom_Data::Custom_End
Custom_Start:LabID:Custom_Data::Custom_End
Custom_Start:LabStageID:Custom_Data::Custom_End

      </gsak:CustomData>
    </gsak:wptExtension>
  <groundspeak:cache id="8232401" available="True" archived="False" xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">
   <groundspeak:name>???? #22# les su��doises de la for��t de ???????</groundspeak:name>
   <groundspeak:placed_by>geotrou</groundspeak:placed_by>
   <groundspeak:owner id="2580031">geotrou</groundspeak:owner>
   <groundspeak:type>Unknown Cache</groundspeak:type>
   <groundspeak:container>Micro</groundspeak:container>
   <groundspeak:attributes>
     <groundspeak:attribute id="40" inc="1">Stealth required</groundspeak:attribute>
     <groundspeak:attribute id="51" inc="1">Special Tool Required</groundspeak:attribute>
   </groundspeak:attributes>
   <groundspeak:difficulty>5</groundspeak:difficulty>
   <groundspeak:terrain>4.5</groundspeak:terrain>
   <groundspeak:country>France</groundspeak:country>
   <groundspeak:state>Grand-Est</groundspeak:state>
   <groundspeak:short_description html="False"> </groundspeak:short_description>
   <groundspeak:long_description html="True">&lt;p&gt;&lt;a href="https://www.jigidi.com/solve/fyabct6f/scorpion2/"&gt;&lt;img alt src="https://s3.amazonaws.com/gs-geo-images/d230f50b-5dd6-4992-9c07-9da3385b831f_l.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;Pour obtenir les coordonn��es de cette cache vous devez faire un petit puzzle ,&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;chercher &lt;span style="color:#e74c3c;"&gt;l'infra ordre&lt;/span&gt; de ce qui est repr��sent�� et l'inscrire dans "Certitude"&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;en lettres majuscules sans espace ni accent&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;strong&gt;&lt;span style="font-family:georgia,serif;"&gt;&lt;em&gt;bonnes recherches &lt;img alt src="https://s3.amazonaws.com/gs-geo-images/2f5f2b4a-511d-41ba-bc42-0e5e59b39a10_l.jpg" /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;center&gt;&lt;a href="https://www.certitudes.org/certitude?wp=GC9B498"&gt;&lt;img src="https://www.certitudes.org/logo?wp=GC9B498" border="0" title="Cliquer pour voir la liste des utilisateurs ayant r��solu l'��nigme" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;font face="Comic Sans MS"&gt;Vous pouvez valider votre solution d'��nigme avec &lt;a href="https://www.certitudes.org/certitude?wp=GC9B498"&gt;certitude&lt;/a&gt;.&lt;/font&gt;&lt;/center&gt;</groundspeak:long_description>
    <groundspeak:encoded_hints></groundspeak:encoded_hints>
   <groundspeak:logs>
    <groundspeak:log id="-2">
    <groundspeak:date>2023-01-07T08:00:00</groundspeak:date>
    <groundspeak:type>Write note</groundspeak:type>
    <groundspeak:finder id="0">GSAK</groundspeak:finder>
    <groundspeak:text encoded="False">son sous ordre

    </groundspeak:text>
   </groundspeak:log>
  </groundspeak:logs>
   <groundspeak:travelbugs>
   </groundspeak:travelbugs>
</groundspeak:cache>
</wpt>
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 15:03:44
Quote Anchor link
Zie mijn vorige reactie. Je mistte de </gpx> tag.

Dan krijg ik netjes dit te zien:
Quote:
50.558333
4.101667
GCA02MB
26. Il y a de l'illusion dans l'air by Jc et Fr (2/2)
Geocache|Unknown Cache
Gewijzigd op 19/02/2023 15:04:28 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 17:09:46
Quote Anchor link
Ja dat krijg ik ook , en deze kan ik uitlezen.
Het is maar als je aan dit komt :
<groundspeak:difficulty>5</groundspeak:difficulty>
<groundspeak:terrain>4</groundspeak:terrain>
deze met groundspeak zijn niet te bereiken :
zlefs niet met
$sxe = new SimpleXMLElement($xml); geeft foutmeldingen

probeer maar eentje van de groundspeak in een string te krijgen
Gewijzigd op 19/02/2023 17:11:04 door Berta Pappens
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 17:17:13
Quote Anchor link
Ik krijg ook een berg aan warnings, maar dat komt door die brakke namespaces.
Die heb ik onderdrukt:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
$xml
= @simplexml_load_string($string) or die("Error: Cannot create object");
?>


Waar haal je die XML eigenlijk vandaan?
Gewijzigd op 19/02/2023 17:18:16 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 17:26:01
Quote Anchor link
Dit blijft nog steeds warnings geven :
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '&lt;' not found in C:\xampp\htdocs\geo_db_gpx_gsak\test.php on line 5
Warning: simplexml_load_string(): c:/geo_db/test.gpx in C:\xampp\htdocs\geo_db_gpx_gsak\test.php on line 5
Warning: simplexml_load_string(): ^ in C:\xampp\htdocs\geo_db_gpx_gsak\test.php on line 5
Error: Cannot create object

voor de code
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
header ('Content-type: text/html; charset=utf8mb4');

//$xml=simplexml_load_file("c:/geo_db/test.gpx") or die("Error: Cannot create object");
$xml = simplexml_load_string ("c:/geo_db/test.gpx") or die ( "Error: Cannot create object" );

$sxe=new SimpleXMLElement($xml);

echo $xml->wpt[0]['lat'] . "<br>";
echo $xml->wpt[0]['lon'] . "<br>";
echo $xml->wpt[0]->name . "<br>";
echo $xml->wpt[0]->desc . "<br>";
echo $xml->wpt[0]->type . "<br>";

?>
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 17:28:54
Quote Anchor link
Zie mijn vorige code om de errors te onderdrukken.

En zet dit eens neer na je lijn waar je $sxe defineert:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
echo "<pre>";
print_r($sxe);
echo "</pre>";

Dan zal je een boom van je array zien wat meer duidelijkheid geeft.
Nog een tip: Gebruik geen C:/ als pad. Als je de boel uploadt, dan zal het niet gevonden worden.
Gewijzigd op 19/02/2023 17:36:24 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 17:33:46
Quote Anchor link
Ik heb uw 3 lijntjes onder de $sxe geplaatst en dit geeft geen resultaat.
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 17:38:47
Quote Anchor link
Je zou een array moeten zien van je XML-file. Let het pad.

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
<?php
header ('Content-type: text/html; charset=utf8mb4');
$string = file_get_contents("geocaches_new.xml");
$xml = @simplexml_load_string($string) or die("Error: Cannot create object");

echo "<pre>";
print_r($xml->wpt);
echo "</pre>";
?>
Gewijzigd op 19/02/2023 17:38:58 door - Ariën -
 
Berta Pappens

Berta Pappens

19/02/2023 17:42:36
Quote Anchor link
Inderdaad maar deze met groundspeak zie je niet (dit zijn de belangrijkste.

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [lat] => 48.83125
            [lon] => 8.5156666666666663
        )

    [time] => 2015-05-01T08:00:00Z
    [name] => GC5M3ZT
    [desc] => 2004 - 15 Jahre Geocaching by ichel (1/2,5)
    [url] => http://coord.info/GC5M3ZT
    [urlname] => 2004 - 15 Jahre Geocaching by ichel
    [sym] => Geocache
    [type] => Geocache|Unknown Cache
)
 
- Ariën  -
Beheerder

- Ariën -

19/02/2023 18:02:59
Quote Anchor link
Hoe bedoel je?
Ik krijg volledige XML als array.
 

Pagina: « vorige 1 2 3 4 volgende »



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.