Sady Home

Note my coding life

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

Attribute Value Description
xlink:actuate onLoad
onRequest
other
none
Defines when the linked resource is read and shown
xlink:href URL The URL to link to
xlink:show embed
new
replace
other
none
Where to open the link. Replace is default
xlink:type simple
extended
locator
arc
resource
title
none
The type of link

* Reference to W3C Schools
posted on 2007-12-11 09:38  Sady  阅读(359)  评论(0编辑  收藏  举报
凭飞堂