以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XQuery/XLink/XPointer/ 』  (http://bbs.xml.org.cn/list.asp?boardid=14)
----  XPointer Syntax--XPointer语法  (http://bbs.xml.org.cn/dispbbs.asp?boardid=14&rootid=&id=45297)


--  作者:xml-linguist
--  发布时间:4/12/2007 10:15:00 AM

--  XPointer Syntax--XPointer语法
In HTML, we can create a hyperlink that either points to an HTML page or to a bookmark inside an HTML page (using #).
在HTML中,我们可以利用超链接来链接到一个HTML页面或利用#链接到HTML页面中的一个标签。

Sometimes it is more useful to point to more specific content. For example, let's say that we want to link to the third item in a particular list, or to the second sentence of the fifth paragraph. This is easy with XPointer.
一般来说,链接到具体内容的这一功能用途更为广泛。比如说,要链接到一个列表中的第三个项目、或第五段中的第二句话,这时,使用XPointer就非常容易了。

If the hyperlink points to an XML document, we can add an XPointer part after the URL in the xlink:href attribute, to navigate (with an XPath expression) to a specific place in the document.
链接指向XML文件时,我们可以在xlink:href属性值URL之后加一个XPointer字段,它就可以直接(利用XPath表达式)导向文件中的特定位置。

For example, in the example below we use XPointer to point to the fifth item in a list with a unique id of "rock":

看下例,用XPointer导向列表中含有"rock"这个id的第五子项:
href="http://www.example.com/cdlist.xml#id('rock').child(5,item)"


--  作者:njxyg
--  发布时间:11/9/2008 3:05:00 PM

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