2008年(17)
分类: C/C++
2008-03-17 20:07:13
Path | Description |
---|---|
child::node() |
Select all the children of the context node, whatever their node type. |
attribute::name |
Select the name attribute of the context node. |
attribute::* |
Select all the attributes of the context node. |
descendant::para |
Select the element descendants of the context node. |
ancestor::div |
Select all
|
ancestor-or-self::div |
Select the
|
descendant-or-self::para |
Select the element descendants of the context node and, if the context node is a element, select the context node as well. |
self::para |
Select the context node if it is a element; otherwise select nothing. |
child::chapter/descendant::para |
Select the element descendants of the element children of the context node. |
child::*/child::para |
Select all grandchildren of the context node. |
/ |
Select the document root (which is always the parent of the document element). |
/descendant::para |
Select all the elements in the same document as the context node. |
/descendant::olist/child::item |
Select all the elements that have an parent and that are in the same document as the context node. |
child::para[position()=1] |
Select the first child of the context node. |
|
Select the last child of the context node. |
child::para[position()=last()-1] |
Select the next-to-last child of the context node. |
child::para[position()>1] |
Select all the children of the context node, except for the first child of the context node. |
/descendant::figure[position()=42] |
Select the forty-second element in the document. |
/child::doc/child::chapter[position()=5]/child::section[position()=2] |
Select the second element contained in the fifth element of the document element. |
child::para[attribute::type="warning"] |
Select all children of the context node that have a type attribute with the value "warning" . |
child::para[attribute::type="warning"][position()=5] |
Select the fifth child of the context node that has a type attribute with the value "warning". |
child::para[position()=5][attribute::type="warning"] |
Select the fifth child of the context node if that child has a type attribute with the value "warning". |
child::chapter[child::title="Introduction"] |
Select the children of the context node that have one or more children with string value equal to "Introduction ". |
child::chapter[child::title] |
Select the children of the context node that have one or more children. |
child::*[self::chapter or self::appendix] |
Select the and children of the context node. |
child::*[self::chapter or self::appendix][position()=last()] |
Select the last or child of the context node. |