昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期二, 四月 20, 2010

// 和 descendant 的唯一区别:

// 和 descendant 的唯一区别:

只是给找出来的NODE 赋不同的 POSITION 值而已.

// 给 POSITION 是根据 家里的排行
descendant:: 是根据家族的排行


tr
tr  家里排行老大  position() = 1
tr  家里排行老二  position() = 2
tr  家里排行老大  position() = 1
tr  家里排行老二  position() = 2
tr  家里排行老三  position() = 3
tr   家里排行老大 position() = 1
tr  家里排行老二 position() = 2


If use tr//tr[1] then, all tr with position()=1 will be selected.



tr
tr  族里排行老大  position() = 1
tr  族里排行老二  position() = 2
tr  族里排行老三  position() = 3
tr  族里排行老四  position() = 4
tr  族里排行老五  position() = 5
tr   族里排行老六 position() = 6
tr  族里排行老七 position() = 7


If use tr/descendant::tr[1] then, only the first tr will be selected.


--
Feng

没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.