XLink and XPointer

What is XLink?

  • XLink is short for the XML Linking Language
  • XLink is a language for creating hyperlinks in XML documents
  • XLink is similar to HTML links - but it is a lot more powerful
  • ANY element in an XML document can behave as an XLink
  • XLink supports simple links (like HTML) and extended links (for linking multiple resources together)
  • With XLink, the links can be defined outside of the linked files
  • XLink is a W3C Recommendation

What is XPointer?

  • XPointer is short for the XML Pointer Language
  • XPointer allows the hyperlinks to point to specific parts of the XML document
  • XPointer uses XPath expressions to navigate in the XML document
  • XPointer is a W3C Recommendation

XLink Syntax
xmlns:xlink=“http://www.w3.org/1999/xlink”
xlink:type
xlink:href
xlink:show
href=“http://www.example.com/cdlist.xml#id('rock').child(5,item)”
xlink:href=“http://dog.com/dogbreeds.xml#xpointer(id('Rottweiler'))”
xlink:href=“http://dog.com/dogbreeds.xml#Rottweiler”

<? xml version="1.0" encoding="ISO-8859-1" ?>
  
< dogbreeds >
     <
dog  breed ="Rottweiler"  id ="Rottweiler" >
    
< picture  url ="http://dog.com/rottweiler.gif"   />
     
< history >
       The Rottweiler's ancestors were probably Roman drover dogs...
     
</ history >
     
< temperament >
       Confident, bold, alert and imposing, the Rottweiler is a popular choice for its ability to protect...
     
</ temperament >
   
</ dog >
    <
dog  breed ="FCRetriever"  id ="FCRetriever" >
    
< picture  url ="http://dog.com/fcretriever.gif"   />
    
< history >
       One of the earliest uses of retrieving dogs was to help fishermen retrieve fish from the water...
    
</ history >
    
< temperament >
       The flat-coated retriever is a sweet, exuberant, lively dog that loves to play and retrieve...
    
</ temperament >
   
</ dog >
</
dogbreeds >

XLink Attribute Reference

AttributeValueDescription
xlink:actuateonLoad
onRequest
other
none
Defines when the linked resource is read and shown
xlink:hrefURLThe URL to link to
xlink:showembed
new
replace
other
none
Where to open the link. Replace is default
xlink:typesimple
extended
locator
arc
resource
title
none
The type of link

* Reference to W3C Schools
posted on 2007-12-11 09:38 Sady 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/sady/archive/2007/12/11/990262.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值