以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XQuery/XLink/XPointer/ 』  (http://bbs.xml.org.cn/list.asp?boardid=14)
----  xlink:type=""; xlink:href=""和 type=""; href=""有什么区别吗?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=14&rootid=&id=65207)


--  作者:xml-linguist
--  发布时间:8/1/2008 12:06:00 AM

--  xlink:type=""; xlink:href=""和 type=""; href=""有什么区别吗?
我最初做的形式

    <sentence xlink:xmlns="http://www.w3.org/1999/xlink" xlink:type="extended">
     <english>Hello.
      <voice accent="AmM" xlink:type="locator" xlink:href="Hello-01.mp3"></voice>
      <br/>
      <voice accent="AmF" xlink:type="locator" xlink:href="Hello-02.mp3"></voice>
      <br/>
      <voice accent="BrM" xlink:type="locator" xlink:href="Hello-03.mp3"></voice>
      <br/>
     </english>
     <chinese>喂!
      <voice accent="CPTH" xlink:type="locator" xlink:href="喂.mp3"></voice>
      <br/>
     </chinese>
    </sentence>
    <sentence xlink:xmlns="http://www.w3.org/1999/xlink" xlink:type="extended">
     <english>Hi.
      <voice accent="" xlink:type="locator" xlink:href="Hi.mp3"></voice>
      <br/>
      <voice accent="" xlink:type="locator" xlink:href="Hi.mp3"></voice>
      <br/>
      <voice accent="" xlink:type="locator" xlink:href="Hi.mp3"></voice>
      <br/>
     </english>
     <chinese>嗨!
      <voice accent="" xlink:type="locator" xlink:href="嗨.mp3"></voice>
      <br/>
     </chinese>
    </sentence>
===================================================
后来,朋友给我改成下面的样子了,即,去掉了xlink:type=""; xlink:href=""中的xlink:这一部分。

====================================================
    <sentence xmlns="http://www.w3.org/1999/xlink" xlink:type="extended">
     <english>Hello.
      <voice accent="AmM" type="locator" href="Hello-AmM.mp3"></voice>
      <br/>
      <voice accent="AmF" type="locator" href="Hello-AmF.mp3"></voice>
      <br/>
      <voice accent="BrM" type="locator" href="Hello-BrM.mp3"></voice>
      <br/>
     </english>
     <chinese>喂!
      <voice accent="PTH" type="locator" href="喂-PTH.mp3"></voice>
      <br/>
     </chinese>
    </sentence>
    <sentence xmlns="http://www.w3.org/1999/xlink" xlink:type="extended">
     <english>Hi.
      <voice accent="AmM" type="locator" href="Hi-AmM.mp3"></voice>
      <br/>
      <voice accent="AmF" type="locator" href="Hi-AmF.mp3"></voice>
      <br/>
      <voice accent="BrM" type="locator" href="Hi-BrM.mp3"></voice>
      <br/>
     </english>
     <chinese>嗨!
      <voice accent="PTH" type="locator" href="嗨-PTH.mp3"></voice>
      <br/>
     </chinese>
    </sentence>

======================================
请问:xlink:type=""; xlink:href=""和 type=""; href=""有什么区别吗?


--  作者:xml-linguist
--  发布时间:8/3/2008 1:01:00 AM

--  
这个问题出在namespace:
<sentence xlink:xmlns="http://www.w3.org/1999/xlink" xlink:type="extended">
应该是:
<sentence xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="extended">

一个很低级的错误。


--  作者:xml-linguist
--  发布时间:8/3/2008 1:06:00 AM

--  
解决上以上的问题,就有了以下结论:

“请问:xlink:type=""; xlink:href=""和 type=""; href=""有什么区别吗?”这个问题现在已经没有任何意义了。

如果namespace中的属性名称是xmlns:xlink,子元素中属于这个空间的属性名称就是xlink:type=""; xlink:href=""等等;如果namespace中的属性名称是xmlns,那么子元素中属于这个空间的属性名称就直接命名,如 type=""; href=""等等。


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
70.313ms