-
child::paraselects theparaelement children of the context node -
child::*selects all element children of the context node -
child::text()selects all text node children of the context node -
child::node()selects all the children of the context node, whatever their node type -
attribute::nameselects thenameattribute of the context node -
attribute::*selects all the attributes of the context node -
descendant::paraselects theparaelement descendants of the context node -
ancestor::divselects alldivancestors of the context node -
ancestor-or-self::divselects thedivancestors of the context node and, if the context node is adivelement, the context node as well -
descendant-or-self::paraselects theparaelement descendants of the context node and, if the context node is aparaelement, the context node as well -
self::paraselects the context node if it is aparaelement, and otherwise selects nothing -
child::chapter/descendant::paraselects theparaelement descendants of thechapterelement children of the context node -
child::*/child::paraselects allparagrandchildren of the context node -
/selects the document root (which is always the parent of the document element) -
/descendant::paraselects all theparaelements in the same document as the context node -
/descendant::olist/child::itemselects all theitemelements that have anolistparent and that are in the same document as the context node -
child::para[position()=1]selects the firstparachild of the context node -
child::para[position()=last()]selects the lastparachild of the context node -
child::para[position()=last()-1]selects the last but oneparachild of the context node -
child::para[position()>1]selects all theparachildren of the context node other than the firstparachild of the context node -
following-sibling::chapter[position()=1]selects the nextchaptersibling of the context node -
preceding-sibling::chapter[position()=1]selects the previouschaptersibling of the context node -
/descendant::figure[position()=42]selects the forty-secondfigureelement in the document -
/child::doc/child::chapter[position()=5]/child::section[position()=2]selects the secondsectionof the fifthchapterof thedocdocument element -
child::para[attribute::type="warning"]selects allparachildren of the context node that have atypeattribute with valuewarning -
child::para[attribute::type='warning'][position()=5]selects the fifthparachild of the context node that has atypeattribute with valuewarning -
child::para[position()=5][attribute::type="warning"]selects the fifthparachild of the context node if that child has atypeattribute with valuewarning -
child::chapter[child::title='Introduction']selects thechapterchildren of the context node that have one or moretitlechildren with string-value equal toIntroduction -
child::chapter[child::title]selects thechapterchildren of the context node that have one or moretitlechildren -
child::*[self::chapter or self::appendix]selects thechapterandappendixchildren of the context node -
child::*[self::chapter or self::appendix][position()=last()]selects the lastchapterorappendixchild of the context node
相关文章: