座標軸會指定位置步驟與內容節點所選取節點之間的樹狀結構關聯性。 支援下列座標軸: 子軸
包含內容節點的子系。
下列 XPath 運算式 (位置路徑) 會從目前內容節點中選取所有 <Customer> 子系:
child::Customer在下列 XPath 查詢中,
child是座標軸。Customer是節點測試。parent
包含內容節點的父代。
下列 XPath 運算式會選取 Order> 子系的所有 <Customer> 父代:<
child::Customer/child::Order[parent::Customer/@customerID="ALFKI"]這與指定
child::Customer相同。 在此 XPath 查詢中,child和parent是座標軸。Customer和Order是節點測試。attribute
包含內容節點的屬性。
下列 XPath 運算式會 選取內容節點的 CustomerID 屬性:
attribute::CustomerID自我
包含內容節點本身。
如果它是 Order> 節點,下列 XPath 運算式會選取目前的節點<:
self::Order在此 XPath 查詢中,
self是座標軸,而且Order是節點測試。