您现在的位置: 365建站网 > 建站教程 > XML 教程 > 现实生活中的 XML

现实生活中的 XML

此节有 206 人学习过     参与评论

一个现实生活中的例子,向您展示 XML 如何携带数据。

实例: XML 新闻

XMLNews 是用于交换新闻和其他信息的规范。

对新闻的供求双方来说,通过使用这种标准,可以使各种类型的新闻信息通过不同软硬件以及编程语言进行的制作、接收和存档更加容易。

一个 XMLNews 文档实例:

</>code

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <nitf>
  3. <head>
  4. <title>Colombia Earthquake</title>
  5. </head>
  6. <body>
  7. <headline>
  8. <hl1>143 Dead in Colombia Earthquake</hl1>
  9. </headline>
  10. <byline>
  11. <bytag>By Jared Kotler, Associated Press Writer</bytag>
  12. </byline>
  13. <dateline>
  14. <location>Bogota, Colombia</location>
  15. <date>Monday January 25 1999 7:28 ET</date>
  16. </dateline>
  17. </body>
  18. </nitf>

实例:XML Weather Service

国家气象服务案例,来自 NOAA (National Oceanic and Atmospheric Administration):

</>code

  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. <current_observation>
  3. <credit>NOAA's National Weather Service</credit>
  4. <credit_URL>http://weather.gov/</credit_URL>
  5. <image>
  6. <url>http://weather.gov/images/xml_logo.gif</url>
  7. <title>NOAA's National Weather Service</title>
  8. <link>http://weather.gov</link>
  9. </image>
  10. <location>New York/John F. Kennedy Intl Airport, NY</location>
  11. <station_id>KJFK</station_id>
  12. <latitude>40.66</latitude>
  13. <longitude>-73.78</longitude>
  14. <observation_time_rfc822>
  15. Mon, 11 Feb 2008 06:51:00 -0500 EST
  16. </observation_time_rfc822>
  17. <weather>A Few Clouds</weather>
  18. <temp_f>11</temp_f>
  19. <temp_c>-12</temp_c>
  20. <relative_humidity>36</relative_humidity>
  21. <wind_dir>West</wind_dir>
  22. <wind_degrees>280</wind_degrees>
  23. <wind_mph>18.4</wind_mph>
  24. <wind_gust_mph>29</wind_gust_mph>
  25. <pressure_mb>1023.6</pressure_mb>
  26. <pressure_in>30.23</pressure_in>
  27. <dewpoint_f>-11</dewpoint_f>
  28. <dewpoint_c>-24</dewpoint_c>
  29. <windchill_f>-7</windchill_f>
  30. <windchill_c>-22</windchill_c>
  31. <visibility_mi>10.00</visibility_mi>
  32. <icon_url_base>
  33. http://weather.gov/weather/images/fcicons/
  34. </icon_url_base>
  35. <icon_url_name>nfew.jpg</icon_url_name>
  36. <two_day_history_url>
  37. http://www.weather.gov/data/obhistory/KJFK.html
  38. </two_day_history_url>
  39. <disclaimer_url>
  40. http://weather.gov/disclaimer.html
  41. </disclaimer_url>
  42. <copyright_url>
  43. http://weather.gov/disclaimer.html
  44. </copyright_url>
  45. </current_observation>

如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛

发表评论 (206人查看0条评论)
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
昵称:
最新评论
------分隔线----------------------------

快速入口

· 365软件
· 杰创官网
· 建站工具
· 网站大全

其它栏目

· 建站教程
· 365学习

业务咨询

· 技术支持
· 服务时间:9:00-18:00
365建站网二维码

Powered by 365建站网 RSS地图 HTML地图

copyright © 2013-2024 版权所有 鄂ICP备17013400号