Ik wil in een gpx file gaan lezen vanaf een bepaalde plaats(vb waar telkens <wpt begint) , daar maak ik dan een file van fread($fopen, 3800); met deze grootte, daarna moet er terug gezocht worden naar <wpt om terug een file van 3800 van te maken.
Ziet iemand dit zitten om hier een klein voorbeeld van te geven ?
Als je wil kan ik altijd de gpx aan iemand laten geworden.(blijkbaar kan ik hier geen file doorsturen)
<?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>
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.
$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
Blijkbaar is het met dit ook niet te eenvoudig om een gpx uit te lezen ...
[size=xsmall]Toevoeging op 19/02/2023 09:50:40:[/size]
Ariën hier zijn 2 stuks
<?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"><p style="text-align:center;"><img src="https://img.geocaching.com:443/8e0188ec-8fe0-4a56-a109-6d2326125bcf.png" /></p>
<p>Cette cache fait partie d'une série de 41 mystères qui vous emmèneront faire une balade de <span style="color:#2ecc71;">+/- 8 kms à vol d'oiseau.</span></p>
<p>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.</p>
<p><span style="color:#e74c3c;">N’oubliez pas votre canne à pêche, vous en aurez besoin à 8 reprises.</span></p>
<p>Vous pouvez commencer la balade où vous voulez puisqu'il n'y a pas de bonus.</p>
<p>La difficulté indiquée en haut de la page est celle que vous rencontrerez sur place.</p>
<p>La difficulté de la résolution de cette cache-ci est du niveau 2.</p>
<p>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. <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" /></p>
<p>Soit une question vous sera posée et la réponse devra être entrée dans un checker certitude. <span style="color:#e74c3c;">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.</span> Une bonne réponse entrainera la réception des coordonnées nord ou est de la boite finale. Conservez-les.</p>
<p>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.</p>
<p>Bon amusement !</p>
<p> </p>
<p>Pour réaliser le premier puzzle, cliquez sur le lien suivant :</p>
<p> </p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.jigidi.com/solve/3aojqm5h/26-a/"><img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /></a></p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.certitudes.org/certitude?wp=W1A02MB"><img src="https://www.certitudes.org/logo?wp=W1A02MB" title="Cliquer pour voir la liste des utilisateurs ayant résolu l'énigme" /></a><br />
<span style="font-family:Comic Sans MS;">Vous pouvez valider votre solution d'énigme avec <a href="https://www.certitudes.org/certitude?wp=W1A02MB">certitude</a>.</span></p>
<p> </p>
<p>Pour réaliser le second puzzle, cliquez sur le lien suivant :</p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.jigidi.com/solve/gr8k5yxw/26-b/"><img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /></a></p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.certitudes.org/certitude?wp=W2A02MB"><img src="https://www.certitudes.org/logo?wp=W2A02MB" title="Cliquer pour voir la liste des utilisateurs ayant résolu l'énigme" /></a><br />
<span style="font-family:Comic Sans MS;">Vous pouvez valider votre solution d'énigme avec <a href="https://www.certitudes.org/certitude?wp=W2A02MB">certitude</a>.</span></p></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"><p style="text-align:center;"><img src="https://img.geocaching.com:443/ce583082-fba5-4f1c-92fd-a8d0f2874ea1.png" /></p>
<p>Cette cache fait partie d'une série de 41 mystères qui vous emmèneront faire une balade de <span style="color:#2ecc71;">+/- 8 kms à vol d'oiseau.</span></p>
<p>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.</p>
<p><span style="color:#e74c3c;">N’oubliez pas votre canne à pêche, vous en aurez besoin à 8 reprises.</span></p>
<p>Vous pouvez commencer la balade où vous voulez puisqu'il n'y a pas de bonus.</p>
<p>La difficulté indiquée en haut de la page est celle que vous rencontrerez sur place.</p>
<p>La difficulté de la résolution de cette cache-ci est du niveau 2.</p>
<p>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. <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" /></p>
<p>Soit une question vous sera posée et la réponse devra être entrée dans un checker certitude. <span style="color:#e74c3c;">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.</span> Une bonne réponse entrainera la réception des coordonnées nord ou est de la boite finale. Conservez-les.</p>
<p>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.</p>
<p>Bon amusement !</p>
<p> </p>
<p>Pour réaliser le premier puzzle, cliquez sur le lien suivant :</p>
<p> </p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.jigidi.com/solve/h15bo764/28-a/"><img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /></a></p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.certitudes.org/certitude?wp=W1A02MK"><img src="https://www.certitudes.org/logo?wp=W1A02MK" title="Cliquer pour voir la liste des utilisateurs ayant résolu l'énigme" /></a><br />
<span style="font-family:Comic Sans MS;">Vous pouvez valider votre solution d'énigme avec <a href="https://www.certitudes.org/certitude?wp=W1A02MK">certitude</a>.</span></p>
<p> </p>
<p>Pour réaliser le second puzzle, cliquez sur le lien suivant :</p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.jigidi.com/solve/zp88ye9u/28-b/"><img alt src="https://img.geocaching.com/cache/large/5ab61dea-f76f-473b-b6a9-9aefd73653a8.png?rnd=0.3294783" /></a></p>
<p>.</p>
<p style="text-align:center;"><a href="https://www.certitudes.org/certitude?wp=W2A02MK"><img src="https://www.certitudes.org/logo?wp=W2A02MK" title="Cliquer pour voir la liste des utilisateurs ayant résolu l'énigme" /></a><br />
<span style="font-family:Comic Sans MS;">Vous pouvez valider votre solution d'énigme avec <a href="https://www.certitudes.org/certitude?wp=W2A02MK">certitude</a>.</span></p></groundspeak:long_description>
<groundspeak:encoded_hints></groundspeak:encoded_hints>
<groundspeak:logs>
</groundspeak:logs>
<groundspeak:travelbugs>
</groundspeak:travelbugs>
</groundspeak:cache>
</wpt>
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