X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0dd10c3fff9896ca23b884a7ec7a97002065d083..ff36d7d8df16d1a1d94656bda7b8b7d4b9422a3a:/lib/template/address-xml.php diff --git a/lib/template/address-xml.php b/lib/template/address-xml.php index 9989bb31..a17da738 100644 --- a/lib/template/address-xml.php +++ b/lib/template/address-xml.php @@ -1,44 +1,87 @@ \n"; - - echo "\n"; - - if (!sizeof($aPlace)) - { - if (isset($sError)) - echo "$sError"; - else - echo "Unable to geocode"; - } - else - { - echo "".htmlspecialchars($aPlace['langaddress']).""; - - if ($bShowAddressDetails) { - echo ""; - foreach($aAddress as $sKey => $sValue) - { - $sKey = str_replace(' ','_',$sKey); - echo "<$sKey>"; - echo htmlspecialchars($sValue); - echo ""; - } - echo ""; - } - } - - echo ""; +header('content-type: text/xml; charset=UTF-8'); + +echo '<'; +echo '?xml version="1.0" encoding="UTF-8" ?'; +echo ">\n"; + +echo '\n"; + +if (empty($aPlace)) { + if (isset($sError)) + echo "$sError"; + else echo 'Unable to geocode'; +} else { + echo ''.htmlspecialchars($aPlace['langaddress']).''; + + if (isset($aPlace['address'])) { + echo ''; + foreach ($aPlace['address']->getAddressNames() as $sKey => $sValue) { + $sKey = str_replace(' ', '_', $sKey); + echo "<$sKey>"; + echo htmlspecialchars($sValue); + echo ""; + } + echo ''; + } + + if (isset($aPlace['sExtraTags'])) { + echo ''; + foreach ($aPlace['sExtraTags'] as $sKey => $sValue) { + echo ''; + } + echo ''; + } + + if (isset($aPlace['sNameDetails'])) { + echo ''; + foreach ($aPlace['sNameDetails'] as $sKey => $sValue) { + echo ''; + echo htmlspecialchars($sValue); + echo ''; + } + echo ''; + } + + if (isset($aPlace['askml'])) { + echo "\n"; + echo $aPlace['askml']; + echo ''; + } +} + +echo '';