Vie réelle XML


Quelques exemples d'utilisation de XML pour échanger des informations.


Exemple : XML News

XMLNews est une spécification pour échanger des actualités et d'autres informations.

Pour les fournisseurs et les consommateurs d'actualités, l'utilisation de cette norme facilite la production, la réception et l'archivage de divers types d'informations d'actualité sur différents matériels, logiciels et langages de programmation :

<?xml version="1.0" encoding="ISO-8859-1"?>
<nitf>
<head>
<title>Tremblement de terre en Colombie</title>
</head>
<body>
<headline>
<hl1>143 morts dans un séisme en Colombie</hl1>
</headline>
<byline>
<bytag>Par Jared Kotler, journaliste d'Associated Press</bytag>
</byline>
<dateline>
<location>Bogota, Colombie</location>
<date>lundi 25 janvier 1999 7:28 ET</date>
</dateline>
</body>
</nitf>


Exemple : service météo XML

Cas du National Weather Service XML, de la NOAA (National Oceanic and Atmospheric Administration) :

<?xml version="1.0" encoding="ISO-8859-1" ?>
<current_observation>

<credit>Service météorologique national de la NOAA</credit>
<credit_URL>http://weather.gov/</credit_URL>

<image>
<url>http://weather.gov/images/xml_logo.gif</url>
<title>Service météorologique national de la NOAA</title>
<link>http://weather.gov</link>
</image>

<location>New York/Aéroport international John F. Kennedy, NY</location>
<station_id>KJFK</station_id>
<latitude>40.66</latitude>
<longitude>-73.78</longitude>
<observation_time_rfc822>Mon, 11 Feb 2008 06:51:00 -0500 EST</observation_time_rfc822>
</observation_time_rfc822>

<weather>Quelques nuages</weather>
<temp_f>11</temp_f>
<temp_c>-12</temp_c>
<relative_humidity>36</relative_humidity>
<wind_dir>Ouest</wind_dir>
<wind_degrees>280</wind_degrees>
<wind_mph>18.4</wind_mph>
<wind_gust_mph>29</wind_gust_mph>
<pressure_mb>1023.6</pressure_mb>
<pressure_in>30.23</pressure_in>
<dewpoint_f>-11</dewpoint_f>
<dewpoint_c>-24</dewpoint_c>
<windchill_f>-7</windchill_f>
<windchill_c>-22</windchill_c>
<visibility_mi>10.00</visibility_mi>

<icon_url_base>http://weather.gov/weather/images/fcicons/</icon_url_base>
<icon_url_name>nfew.jpg</icon_url_name>
<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
<copyright_url>http://weather.gov/disclaimer.html</copyright_url>

</current_observation>


Autres extensions