2012. 4. 20. 05:20

XPath Axes

XML 을 꽤 오랫동안 사용해 왔지만 늘 사용하는 것만 사용하게 되는 것 같습니다. XPath 에서 사용할 수 있는 축에 대해서 소개하는 글입니다. 


출처: http://www.w3schools.com/xpath/xpath_axes.asp


AxisNameResult
ancestorSelects all ancestors (parent, grandparent, etc.) of the current node
ancestor-or-selfSelects all ancestors (parent, grandparent, etc.) of the current node and the current node itself
attributeSelects all attributes of the current node
childSelects all children of the current node
descendantSelects all descendants (children, grandchildren, etc.) of the current node
descendant-or-selfSelects all descendants (children, grandchildren, etc.) of the current node and the current node itself
followingSelects everything in the document after the closing tag of the current node
following-siblingSelects all siblings after the current node
namespaceSelects all namespace nodes of the current node
parentSelects the parent of the current node
precedingSelects all nodes that appear before the current node in the document, except ancestors, attribute nodes and namespace nodes
preceding-siblingSelects all siblings before the current node
selfSelects the current node