设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > XML

XML、RDF和sitemap

作者:佚名 出处:网络转载 时间:07-26 点击:

内容载入中...

Mozilla最重要的新特征是它支持W3C设计的作为HTML替代物的XML。

不去讨论XML的所有特征,我们集中在Mozilla的第一个基于XML的特征 - sitemaps - 你可以在浏览器的当前可下载版本中试用。

Sitemaps

当你在Mozilla中打开www.hotwired.com时,你会在窗口左边看到什么?它是Mozilla的新的"Navigation Center",即我们的sitemap。(如果你的Mozilla版本中未出现sitemap,点击Navigation Center中的"Site Tools"使它弹出来。)

这是HotWired sitemap的样子。

sitemap是Mozilla的已有的新特征中最显著的。它们用RDF(resource description framework)书写,一个W3C仍在开发的XML应用程序。Mozilla通过在页面中寻找<LINK rel=sitemap>发现RDF sitemap,象这样:

<LINK REL=sitemap SRC="/rdf/sitemap.rdf#root" NAME="HotWired" TYPE="text/rdf">
这个标记符告诉Mozilla在www.hotwired.com/rdf/sitemap.rdf打开sitemap,然后在id="root"处开始绘制网站树。

sitemap是用RDF写的网站的结构描述。一个简单的这样的连接指向的sitemap文件如下所示:


<RDF:RDF>

<Topic id="root"

name="Webmonkey">

<child>

<Topic id="Webmonkey RDF Geeks">

<child name="Paul" rdf:href="http://www.hotwired.com/members/profile/mrpaul"

smallIcon="http://www.webmonkey.com/authors/images/paul_smallIcon.gif"/>

<child name="Taylor" rdf:href="http://www.hotwired.com/members/profile/taylor"

smallIcon="http://www.webmonkey.com/authors/images/taylor_smallIcon.gif"/>

</Topic>

</child>

<child>

<Topic id="Webmonkey Network"

smallIcon="http://www.hotwired.com/rdf/objects/monkey_smallIcon.gif">

<child rdf:href="http://www.webmonkey.com/" name="Webmonkey"/>

<child rdf:href="http://www.pcwebopaedia.com/" name="PCWebopaedia"/>

<child rdf:href="http://www.insidedhtml.com" name="InsideDHTML"/>

<child rdf:href="http://www.highfive.com" name="High Five"/>

</Topic>

</child>

</Topic>

</RDF:RDF>

收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口
<< 上一篇 :XML未来的设计
>> 下一篇 :RDF和Cheat Sheet

站长学院

推荐信息