XML interface update to version 1.3, see htdocs/doc/xml/xml11.html
- new caches element <wpts> for additional waypoints - added time to logs <date> field - renamed pictures <attributes> field to <picattr> - added preview flag to <picattr> - fixed errors in v1.1 and 1.2 DTDs
This commit is contained in:
parent
a35c1b5d0e
commit
a93c994aa9
@ -1403,6 +1403,10 @@
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF NEW.`type`=1 THEN
|
||||
IF (ISNULL(@XMLSYNC) OR @XMLSYNC!=1) THEN
|
||||
/* update caches modification date for XML interface handling */
|
||||
UPDATE `caches` SET `last_modified`=NEW.`last_modified` WHERE `cache_id`=NEW.`cache_id`;
|
||||
END IF;
|
||||
CALL sp_update_cache_listingdate(NEW.`cache_id`);
|
||||
END IF;
|
||||
END;");
|
||||
@ -1422,6 +1426,10 @@
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF NEW.`type`=1 THEN
|
||||
IF (ISNULL(@XMLSYNC) OR @XMLSYNC!=1) THEN
|
||||
/* update caches modification date for XML interface handling */
|
||||
UPDATE `caches` SET `last_modified`=NEW.`last_modified` WHERE `cache_id`=NEW.`cache_id`;
|
||||
END IF;
|
||||
CALL sp_update_cache_listingdate(NEW.`cache_id`);
|
||||
END IF;
|
||||
IF OLD.`cache_id`!=NEW.`cache_id` AND OLD.`type`=1 THEN
|
||||
@ -1434,6 +1442,10 @@
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF OLD.`type`=1 THEN
|
||||
IF (ISNULL(@XMLSYNC) OR @XMLSYNC!=1) THEN
|
||||
/* update caches modification date for XML interface handling */
|
||||
UPDATE `caches` SET `last_modified`=NOW() WHERE `cache_id`=OLD.`cache_id`;
|
||||
END IF;
|
||||
CALL sp_update_cache_listingdate(OLD.`cache_id`);
|
||||
END IF;
|
||||
END;");
|
||||
|
@ -3,7 +3,7 @@
|
||||
<title>Dokumentation Opencaching XML-Interface Version 1.2</title>
|
||||
<meta name="vs_showGrid" content="True">
|
||||
</head>
|
||||
<body>
|
||||
<body style="font-family: arial, sans-serif, Tahoma, Verdana; font-size:12px">
|
||||
<h1>Dokumentation Opencaching XML-Interface Version 1.2</h1>
|
||||
<p>
|
||||
Das XML-Interface dient zum automatisierten abfragen aller Caches, Logeinträge,
|
||||
@ -23,7 +23,7 @@
|
||||
<span style="color:red">The downloaded data is copyrighted and must only be used under the terms of <a href="http://www.opencaching.de/articles.php?page=impressum&locale=EN#datalicense">Opencaching.de data license</a>.</span></em>
|
||||
</p>
|
||||
|
||||
<h2>Änderungen in Version 1.2</h2>
|
||||
<h2>Änderungen in Version 1.2 (Februar 2013)</h2>
|
||||
<ul>
|
||||
<li>neues Attribut <em>ispublishdate</em> bei cache.datecreated</li>
|
||||
<li>Ausgabe von Nano-Cachgrößen</li>
|
||||
@ -38,6 +38,14 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Änderungen in Version 1.3 (Mai 2013)</h2>
|
||||
<ul>
|
||||
<li>Zusätzliche Wegpunkte von Caches werden nun in einer <wpts>...</wpts>-Liste mitgeliefert.</li>
|
||||
<li>Das <date>-Element von Logs enthält nun auch die Uhrzeit. 00:00:00 bedeutet, dass keine Uhrzeit geloggt wurde; alles andere bedeutet, dass mit Stunde und Minute geloggt wurde.</li>
|
||||
<li>Element für Bildeigenschaften von <attributes> in <picattr> umbenannt, um Kollisionen mit dem Cache-Attribut-Element zu vermeiden.</li>
|
||||
<li>Vorschaubild-Flag (<em>preview</em>) zu <picattr> hinzugefügt.</li>
|
||||
</ul>
|
||||
|
||||
<p>Der XML-Doctype lautet in allen Versionen "oc11xml".</p>
|
||||
<h2>Ausgabeformat</h2>
|
||||
<p>
|
||||
@ -137,9 +145,13 @@
|
||||
<datecreated ispublishdate="0">2005-09-08 15:45:02</datecreated><br>
|
||||
<lastmodified>2005-12-20 20:58:41</lastmodified><br>
|
||||
<attributes><br>
|
||||
<attribute id="6"><![CDATA[ Nur bei Opencaching]]></attribute><br>
|
||||
<attribute id="6"><![CDATA[Nur bei Opencaching]]></attribute><br>
|
||||
</attributes><br>
|
||||
</cache></P>
|
||||
<wpts><br />
|
||||
<wpt id="25" type="1" typename="Parking" longitude="8.01667" latitude="50.00000"><![CDATA[Parkplatz, von hier 1 km Fußweg]]></wpt><br />
|
||||
<wpt id="26" type="2" typename="Stage or reference point" longitude="8.02333" latitude="50.01544"><![CDATA[Station 1]]></wpt><br />
|
||||
</wpts><br />
|
||||
</cache></p>
|
||||
<p><em>lastmodified</em> ist das letzte Änderungsdatum des cache-Datensatzes, ohne Änderungen an Cachebeschreibungen oder Bildern. Für das Gesamt-Änderungsdatum des Listings müssen Letztere also mit "eingerechnet" werden. Ein Gesamt-Änderungsdatum des Listings kann bei Bedarf eingebaut werden.</p>
|
||||
<p><em>datecreated</em> ist bei mit OC Version 1 und 2 angelegten Caches das Datum, an dem das Listing angelegt wurde, bei mit Version 3 angelegten Caches das Veröffentlichungsdatum. Ab Interface Version 1.2 zeigt das Attribut <em>ispublishdate="1"</em> an, dass es sich um das Veröffentlichungsdatum handelt.</p>
|
||||
<p>Ab XML-Version 1.2 werden im <em>size</em>-Feld auch Nano-Größen zurückgeliefert. In älteren Interface-Versionen wird stattdessen "micro" ausgegeben.</p>
|
||||
@ -176,7 +188,7 @@
|
||||
uuid="CAA9E3C5-50DF-4E9E-191F-CECABA6A8A19"><![CDATA[Team
|
||||
Schnitzeljagd]]></user><BR>
|
||||
<logtype id="1" recommended="0"><![CDATA[Gefunden]]></type><br>
|
||||
<date>2005-05-18</date><br>
|
||||
<date>2005-05-18 16:20:00</date><br>
|
||||
<text><![CDATA[Gut gefunden.&lt;br /&gt;<br>
|
||||
Gr&uuml;&szlig;e von&lt;br /&gt;<br>
|
||||
Volker]]></text><br>
|
||||
@ -193,10 +205,8 @@
|
||||
<title><![CDATA[Schlurfende Gestalten]]></title><br>
|
||||
<desc html="0"></desc><br>
|
||||
<object id="73240" type="1" typename=
|
||||
"cachelog">4FE4B999-315D-43C1-11C2-2B81E68168CD</object><BR>
|
||||
<SPAN class="m"> <</SPAN><SPAN class="t">attributes</SPAN>
|
||||
<SPAN class="t">spoiler</SPAN><SPAN class="m">="</SPAN>0<SPAN class="m">"</SPAN><SPAN class="t"> display</SPAN><SPAN class="m">="</SPAN>1<SPAN class="m">"</SPAN><SPAN class="m"> />< /SPAN>
|
||||
<br>
|
||||
"cachelog">4FE4B999-315D-43C1-11C2-2B81E68168CD</object><br>
|
||||
<picattr spoiler="0" display="1" preview="0" /><br>
|
||||
<datecreated>2005-12-24 01:01:38</datecreated><br>
|
||||
<lastmodified>2005-12-24 01:01:38</lastmodified><br>
|
||||
</picture>
|
||||
@ -259,20 +269,20 @@
|
||||
<p>Paramter uuid ... wie cacheid, ausser dass statt der cacheid die UUID des Caches verwendet wird.</p>
|
||||
<h3>Beispiele</h3>
|
||||
<p>1. Alle Daten inkrementell abrufen<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&user=1&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=1</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&user=1&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=1</a></p>
|
||||
<p>2. Alle Daten von Deutschland inkrementell abrufen<br/>
|
||||
<A>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=0&country=DE&picturefromcachelog=1</a></p>
|
||||
<A>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=0&country=DE&picturefromcachelog=1</a></p>
|
||||
<p>3. Alle Caches ohne Logs von Deutschland inkrementell abrufen<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&cache=1&cachedesc=1&picture=1&removedobject=0&country=DE</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&cache=1&cachedesc=1&picture=1&removedobject=0&country=DE</a></p>
|
||||
<p>4. Alle Daten im Umkreis von 15 km abrufen<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=0&lat=48&lon=9&distance=15&picturefromcachelog=1</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=0&lat=48&lon=9&distance=15&picturefromcachelog=1</a></p>
|
||||
<p>5. Alle Bilder abrufen<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&picture=1</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&picture=1</a></p>
|
||||
<p>6. Alle Bilder von Caches abrufen die in Deutschland versteckt sind<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml2.php?modifiedsince=<date>&picture=1&country=DE</a></p>
|
||||
<p>7. Alle Bilder von Caches und deren Logs abrufen die in Deutschland versteckt
|
||||
sind<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&picture=1&country=DE</a>&picturefromcachelog=1</p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&picture=1&country=DE</a>&picturefromcachelog=1</p>
|
||||
<p>Mit ocxml11.php kann stattdessen die Interface-Version 1.1 verwendet werden.</p>
|
||||
<p>Diese Anfragen werden mit einem kurzen XML-Stream beantwortet, der die
|
||||
XML-Session-Id zurückgibt. Mit dieser Id können dann die Daten abgerufen
|
||||
@ -288,9 +298,9 @@
|
||||
Summe der Datensätze ist in diesem Beispiel 1205 - es werden also 3 Aufrufe
|
||||
benötigt (500, 500, 205 Datensätze).</p>
|
||||
<p>Die Daten können dann mit folgender Anfrage abgerufen werden:<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?sessionid=12345&file=1</a><br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?sessionid=12345&file=2</a><br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?sessionid=12345&file=3</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?sessionid=12345&file=1</a><br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?sessionid=12345&file=2</a><br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?sessionid=12345&file=3</a></p>
|
||||
<p>Die Sessionid ist zwei Stunden lang gültig, wobei sich dieser Zeitraum mit jedem
|
||||
einzelnen Dateiabruf verlängert – zwischen den Einzelabrufen dürfen also
|
||||
maximal zwei Stunden vergehen. Dauert es länger, müsste eine neue sessionid
|
||||
@ -299,14 +309,14 @@
|
||||
<p>Um alle Ergebnisse in einer Datei abzurufen muss bei dem Aufruf der Paramter
|
||||
session auf 0 gesetzt werden.</p>
|
||||
<p>Beispeil:<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&user=1&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=1&session=0</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&user=1&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=1&session=0</a></p>
|
||||
<h3>Dateikomprimierung einstellen</h3>
|
||||
<p>Dei Dateikomprimierung kann mit dem Paramter zip eingestellt weren. Mögliche
|
||||
Werte sind 0, zip, bzip2, gzip. Null bedeutet hier keine Kompression. Wird
|
||||
keine Kompression angegeben, wird zip verwendet.</p>
|
||||
<p>Beispeil:<br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=<date>&user=1&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=1&session=0&zip=bzip2</a><br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml12.php?sessionid=12345&file=1&zip=gzip</a></p>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=<date>&user=1&cache=1&cachedesc=1&cachelog=1&picture=1&removedobject=1&session=0&zip=bzip2</a><br/>
|
||||
<a>http://www.opencaching.de/xml/ocxml13.php?sessionid=12345&file=1&zip=gzip</a></p>
|
||||
<h3>XML-Optionen</h3>
|
||||
<p>Die folgenden XML-Optionen müssen bei jedem Aufruf übergeben
|
||||
werden.</p>
|
||||
@ -320,8 +330,8 @@
|
||||
charset ... (Default) iso-8859-1 / utf-8<br />
|
||||
attrlist ... (Default) 0 = keine Attributliste übertragen / 1 = Attributliste übertragen</p>
|
||||
<h4><a>Beispiele</a></h4>
|
||||
<p>http://www.opencaching.de/xml/ocxml12.php?modifiedsince=20060320000000&user=1&cache=1&cachelog=1&cachedesc=1&picture=1&removedobject=1&session=1&charset=utf-8&cdata=1&xmldecl=0&ocxmltag=0&doctype=0<br/>
|
||||
http://www.opencaching.de/xml/ocxml12.php?sessionid=4711&file=1&charset=utf-8&cdata=1&xmldecl=0&ocxmltag=0&doctype=0</p>
|
||||
<p>http://www.opencaching.de/xml/ocxml13.php?modifiedsince=20060320000000&user=1&cache=1&cachelog=1&cachedesc=1&picture=1&removedobject=1&session=1&charset=utf-8&cdata=1&xmldecl=0&ocxmltag=0&doctype=0<br/>
|
||||
http://www.opencaching.de/xml/ocxml13.php?sessionid=4711&file=1&charset=utf-8&cdata=1&xmldecl=0&ocxmltag=0&doctype=0</p>
|
||||
<h3>Sonstige Anmerkungen</h3>
|
||||
<ul>
|
||||
<li>
|
||||
@ -347,7 +357,7 @@
|
||||
<h3>Ressourcen</h3>
|
||||
<ul>
|
||||
<li>Das XML-Dokument enthält folgende DTD (Document Type Definition):
|
||||
http://www.opencaching.de/xml/ocxml11.dtd (Version 1.1) bzw. http://www.opencaching.de/xml/ocxml12.dtd (Version 1.2)</li>
|
||||
http://www.opencaching.de/xml/ocxmlXX.dtd mit XX = Versionummer, z.B. ocxml12.dtd für Version 1.2.</li>
|
||||
<li>Der Quellcode ist hier erhältlich: <a href="https://github.com/OpencachingDeutschland/oc-server3/tree/stable/htdocs/xml">
|
||||
https://github.com/OpencachingDeutschland/oc-server3/tree/stable/htdocs/xml</a></li>
|
||||
<li>Eine Referenzimplementierung kann hier heruntergeladen werden:
|
||||
|
@ -104,6 +104,9 @@
|
||||
>
|
||||
<!ELEMENT date (#PCDATA)>
|
||||
<!ELEMENT text (#PCDATA)>
|
||||
<!ATTLIST text
|
||||
html CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- picture -->
|
||||
<!ELEMENT url (#PCDATA)>
|
||||
|
@ -486,7 +486,11 @@ function outputXmlFile($sessionid, $filenr, $bXmlDecl, $bOcXmlTag, $bDocType, $z
|
||||
fwrite($f, $t2 . '<datecreated' . $pd . '>' . date($sDateformat, strtotime($r['date_created'])) . '</datecreated>' . "\n");
|
||||
fwrite($f, $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n");
|
||||
|
||||
$rsAttributes = sql("SELECT `cache_attrib`.`id`, `cache_attrib`.`name` FROM `caches_attributes` INNER JOIN `cache_attrib` ON `caches_attributes`.`attrib_id`=`cache_attrib`.`id` WHERE `caches_attributes`.`cache_id`='&1'", $r['id']);
|
||||
$rsAttributes = sql("SELECT `cache_attrib`.`id`, `cache_attrib`.`name`
|
||||
FROM `caches_attributes`
|
||||
INNER JOIN `cache_attrib` ON `caches_attributes`.`attrib_id`=`cache_attrib`.`id`
|
||||
WHERE `caches_attributes`.`cache_id`='&1'",
|
||||
$r['id']);
|
||||
fwrite($f, $t2 . '<attributes>' . "\n");
|
||||
while ($rAttribute = sql_fetch_assoc($rsAttributes))
|
||||
{
|
||||
@ -495,10 +499,23 @@ function outputXmlFile($sessionid, $filenr, $bXmlDecl, $bOcXmlTag, $bDocType, $z
|
||||
fwrite($f, $t2 . '</attributes>' . "\n");
|
||||
sql_free_result($rsAttributes);
|
||||
|
||||
// If additional waypoints are added here, last_modified date handling must be changed
|
||||
// to include also max(last_modified) of all waypoints: either set caches.last_modified via
|
||||
// coordinates trigger, or - better - check coordinates.last_modified when constructing
|
||||
// xml session data.
|
||||
if ($ocxmlversion >= 13)
|
||||
{
|
||||
$rsWaypoints = sql("SELECT `co`.`id`, `co`.`subtype` AS `type`,
|
||||
`co`.`latitude`, `co`.`longitude`, `co`.`description`,
|
||||
`ct`.`name` AS `type_name`
|
||||
FROM `coordinates` `co`
|
||||
INNER JOIN `coordinates_type` `ct` ON `ct`.`id`=`co`.`subtype`
|
||||
WHERE `cache_id`='&1' AND `type`=1
|
||||
ORDER BY `co`.`id` ASC", $r['id']);
|
||||
fwrite($f, $t2 . '<wpts>' . "\n");
|
||||
while ($rWaypoint = sql_fetch_assoc($rsWaypoints))
|
||||
{
|
||||
fwrite($f, $t3 . '<wpt id="' . ($rWaypoint['id']+0) . '" type="' . ($rWaypoint['type']+0) . '" typename="' . xmlentities($rWaypoint['type_name']) . '" longitude="' . sprintf('%01.5f',$rWaypoint['longitude']) . '" latitude="' . sprintf('%01.5f',$rWaypoint['latitude']) . '">' . xmlcdata($rWaypoint['description']) . '</wpt>' . "\n");
|
||||
}
|
||||
fwrite($f, $t2 . '</wpts>' . "\n");
|
||||
sql_free_result($rsAttributes);
|
||||
}
|
||||
|
||||
fwrite($f, $t1 . '</cache>' . "\n");
|
||||
}
|
||||
@ -579,7 +596,7 @@ function outputXmlFile($sessionid, $filenr, $bXmlDecl, $bOcXmlTag, $bDocType, $z
|
||||
fwrite($f, $t2 . '<cacheid id="' . $r['cache_id'] . '">' . $r['cacheuuid'] . '</cacheid>' . "\n");
|
||||
fwrite($f, $t2 . '<userid id="' . $r['user_id'] . '" uuid="' . $r['useruuid'] . '">' . xmlcdata($r['username']) . '</userid>' . "\n");
|
||||
fwrite($f, $t2 . '<logtype id="' . $r['type'] . '" recommended="' . $r['recommended'] . '">' . xmlcdata($logtypes[$r['type']]) . '</logtype>' . "\n");
|
||||
fwrite($f, $t2 . '<date>' . date($sDateshort, strtotime($r['date'])) . '</date>' . "\n");
|
||||
fwrite($f, $t2 . '<date>' . date($ocxmlversion >= 13 ? $sDateformat : $sDateshort, strtotime($r['date'])) . '</date>' . "\n");
|
||||
fwrite($f, $t2 . '<text html="' . $r['text_html'] . '">' . xmlcdata(($bAllowView ? $r['text'] : '')) . '</text>' . "\n");
|
||||
fwrite($f, $t2 . '<datecreated>' . date($sDateformat, strtotime($r['date_created'])) . '</datecreated>' . "\n");
|
||||
fwrite($f, $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n");
|
||||
@ -600,6 +617,7 @@ function outputXmlFile($sessionid, $filenr, $bXmlDecl, $bOcXmlTag, $bDocType, $z
|
||||
`pictures`.`date_created` `date_created`, `pictures`.`uuid` `uuid`,
|
||||
`pictures`.`last_modified` `last_modified`, `pictures`.`display` `display`,
|
||||
`pictures`.`spoiler` `spoiler`, `pictures`.`node` `node`,
|
||||
`pictures`.`mappreview`,
|
||||
IFNULL(`c1`.`cache_id`,`c2`.`cache_id`) AS `cache_id`,
|
||||
IFNULL(`c1`.`country`,`c2`.`country`) AS `language`, /* hack */
|
||||
IFNULL(`cs1`.`allow_user_view`, `cs2`.`allow_user_view`) AS `auv`,
|
||||
@ -624,7 +642,10 @@ function outputXmlFile($sessionid, $filenr, $bXmlDecl, $bOcXmlTag, $bDocType, $z
|
||||
fwrite($f, $t2 . '<url>' . xmlcdata(($bAllowView ? $r['url'] : '')) . '</url>' . "\n");
|
||||
fwrite($f, $t2 . '<title>' . xmlcdata(($bAllowView ? $r['title'] : '')) . '</title>' . "\n");
|
||||
fwrite($f, $t2 . '<object id="' . $r['object_id'] . '" type="' . $r['object_type'] . '" typename="' . xmlentities($objecttypes[$r['object_type']]) . '">' . object_id2uuid($r['object_id'], $r['object_type']) . '</object>' . "\n");
|
||||
fwrite($f, $t2 . '<attributes spoiler="' . $r['spoiler'] . '" display="' . $r['display'] . '" />' . "\n");
|
||||
if ($ocxmlversion >= 13)
|
||||
fwrite($f, $t2 . '<picattr spoiler="' . $r['spoiler'] . '" display="' . $r['display'] . '" preview="' . $r['mappreview'] . '" />' . "\n");
|
||||
else
|
||||
fwrite($f, $t2 . '<attributes spoiler="' . $r['spoiler'] . '" display="' . $r['display'] . '" />' . "\n");
|
||||
fwrite($f, $t2 . '<datecreated>' . date($sDateformat, strtotime($r['date_created'])) . '</datecreated>' . "\n");
|
||||
fwrite($f, $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n");
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
<!ELEMENT attrlist (attr*)>
|
||||
<!ELEMENT user (id, username, pmr, datecreated, lastmodified)>
|
||||
<!ELEMENT cache (id, userid, name, longitude, latitude, type, status, country, size, desclanguages, difficulty, terrain, rating, waypoints, datehidden, datecreated, lastmodified)>
|
||||
<!ELEMENT cachedesc (id, cacheid, language, shortdesc, desc, hint, license, lastmodified)>
|
||||
<!ELEMENT cachelog (id, cacheid, userid, logtype, date, text, license, datecreated, lastmodified)>
|
||||
<!ELEMENT picture (id, url, title, object, attributes, datecreated, lastmodified)>
|
||||
<!ELEMENT cachedesc (id, cacheid, language, shortdesc, desc, hint, license?, lastmodified)>
|
||||
<!ELEMENT cachelog (id, cacheid, userid, logtype, date, text, license?, datecreated, lastmodified)>
|
||||
<!ELEMENT picture (id, url, title, object, attributes, license?, datecreated, lastmodified)>
|
||||
<!ELEMENT removedobject (id, object, removeddate)>
|
||||
|
||||
<!-- common elements -->
|
||||
@ -24,6 +24,7 @@
|
||||
ispublishdate CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT lastmodified (#PCDATA)>
|
||||
<!ELEMENT license (#PCDATA)>
|
||||
|
||||
<!-- attrlist -->
|
||||
<!ELEMENT attr (#PCDATA)>
|
||||
|
147
htdocs/xml/ocxml13.dtd
Normal file
147
htdocs/xml/ocxml13.dtd
Normal file
@ -0,0 +1,147 @@
|
||||
<!ELEMENT oc11xml (attrlist*, user*, cache*, cachedesc*, cachelog*, picture*, removedobject*)>
|
||||
<!ATTLIST oc11xml
|
||||
version CDATA #REQUIRED
|
||||
date CDATA #REQUIRED
|
||||
since CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT attrlist (attr*)>
|
||||
<!ELEMENT user (id, username, pmr, datecreated, lastmodified)>
|
||||
<!ELEMENT cache (id, userid, name, longitude, latitude, type, status, country, size, desclanguages, difficulty, terrain, rating, waypoints, datehidden, datecreated, lastmodified, attributes, wpts)>
|
||||
<!ELEMENT cachedesc (id, cacheid, language, shortdesc, desc, hint, license?, lastmodified)>
|
||||
<!ELEMENT cachelog (id, cacheid, userid, logtype, date, text, license?, datecreated, lastmodified)>
|
||||
<!ELEMENT picture (id, url, title, object, picattr, license?, datecreated, lastmodified)>
|
||||
<!ELEMENT removedobject (id, object, removeddate)>
|
||||
|
||||
<!-- common elements -->
|
||||
<!ELEMENT id (#PCDATA)>
|
||||
<!ATTLIST id
|
||||
id CDATA #IMPLIED
|
||||
node CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT datecreated (#PCDATA)>
|
||||
<!ATTLIST datecreated
|
||||
ispublishdate CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT lastmodified (#PCDATA)>
|
||||
<!ELEMENT license (#PCDATA)>
|
||||
|
||||
<!-- attrlist -->
|
||||
<!ELEMENT attr (#PCDATA)>
|
||||
<!ATTLIST attr
|
||||
id CDATA #REQUIRED
|
||||
icon_large CDATA #REQUIRED
|
||||
icon_no CDATA #REQUIRED
|
||||
icon_undef CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- user -->
|
||||
<!ELEMENT username (#PCDATA)>
|
||||
<!ELEMENT pmr (#PCDATA)>
|
||||
|
||||
<!-- cache -->
|
||||
<!ELEMENT userid (#PCDATA)>
|
||||
<!ATTLIST userid
|
||||
id CDATA #IMPLIED
|
||||
uuid CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT name (#PCDATA)>
|
||||
<!ELEMENT latitude (#PCDATA)>
|
||||
<!ELEMENT longitude (#PCDATA)>
|
||||
<!ELEMENT type (#PCDATA)>
|
||||
<!ATTLIST type
|
||||
id CDATA #REQUIRED
|
||||
short CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT status (#PCDATA)>
|
||||
<!ATTLIST status
|
||||
id CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT country (#PCDATA)>
|
||||
<!ATTLIST country
|
||||
id CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT size (#PCDATA)>
|
||||
<!ATTLIST size
|
||||
id CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT desclanguages (#PCDATA)>
|
||||
<!ELEMENT difficulty (#PCDATA)>
|
||||
<!ELEMENT terrain (#PCDATA)>
|
||||
<!ELEMENT rating (#PCDATA)>
|
||||
<!ATTLIST rating
|
||||
waylength CDATA #REQUIRED
|
||||
needtime CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT waypoints (#PCDATA)>
|
||||
<!ATTLIST waypoints
|
||||
gccom CDATA #IMPLIED
|
||||
nccom CDATA #IMPLIED
|
||||
oc CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT datehidden (#PCDATA)>
|
||||
<!ELEMENT attributes (attribute*)>
|
||||
<!ELEMENT attribute (#PCDATA)>
|
||||
<!ATTLIST attribute
|
||||
id CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT wpts (wpt*)>
|
||||
<!ELEMENT wpt (#PCDATA)>
|
||||
<!ATTLIST wpt
|
||||
id CDATA #REQUIRED
|
||||
type CDATA #REQUIRED
|
||||
typename CDATA #IMPLIED
|
||||
longitude CDATA #REQUIRED
|
||||
latitude CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- cachedesc -->
|
||||
<!ELEMENT cacheid (#PCDATA)>
|
||||
<!ATTLIST cacheid
|
||||
id CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT language (#PCDATA)>
|
||||
<!ATTLIST language
|
||||
id CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT shortdesc (#PCDATA)>
|
||||
<!ELEMENT desc (#PCDATA)>
|
||||
<!ATTLIST desc
|
||||
html CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT hint (#PCDATA)>
|
||||
|
||||
<!-- cachelog -->
|
||||
<!-- cacheid see cachedesc -->
|
||||
<!-- userid see cache -->
|
||||
<!ELEMENT logtype (#PCDATA)>
|
||||
<!ATTLIST logtype
|
||||
id CDATA #REQUIRED
|
||||
recommended CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT date (#PCDATA)>
|
||||
<!ELEMENT text (#PCDATA)>
|
||||
<!ATTLIST text
|
||||
html CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- picture -->
|
||||
<!ELEMENT url (#PCDATA)>
|
||||
<!ELEMENT title (#PCDATA)>
|
||||
<!ELEMENT object (#PCDATA)>
|
||||
<!ATTLIST object
|
||||
id CDATA #IMPLIED
|
||||
type CDATA #REQUIRED
|
||||
typename CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT picattr (#PCDATA)>
|
||||
<!ATTLIST picattr
|
||||
spoiler CDATA #IMPLIED
|
||||
display CDATA #REQUIRED
|
||||
preview CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!-- removedobject -->
|
||||
|
||||
<!-- object see picture -->
|
||||
<!ELEMENT removeddate (#PCDATA)>
|
14
htdocs/xml/ocxml13.php
Normal file
14
htdocs/xml/ocxml13.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
./xml/ocxml12.php
|
||||
|
||||
For license information see doc/license.txt
|
||||
|
||||
Unicode Reminder メモ
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
$ocxmlversion = 13;
|
||||
include("ocxml11.php");
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user