XSLT_Bài tập.
Thursday, May 19, 2016
/
No Comments
- para
selects the para
element children of the context node- *
selects all element children of the context node- text()
selects all text node children of the context node- @name
selects the name
attribute of the context node- @*
selects all the attributes of the context node- para[1]
selects the first para
child of the context node- para[fn:last()]
selects the last para
child of the context node- */para
selects all para
grandchildren of the context node- /book/chapter[5]/section[2]
selects the second section
of the fifth chapter
of the book
whose parent is the document node that contains the context node- chapter//para
selects the para
element descendants of the chapter
element children of the context node- //para
selects all the para
descendants of the root document node and thus selects all para
elements in the same document as the context node- //@version
selects all the version
attribute nodes that are in the same document as the context node- //list/member
selects all the member
elements in the same document as the context node that have a list
parent- .//para
selects the para
element descendants of the context node- ..
selects the parent of the context node- ../@lang
selects the lang
attribute of the parent of the context node- para[@type="warning"]
selects all para
children of the context node that have a type
attribute with value warning
- para[@type="warning"][5]
selects the fifth para
child of the context node that has a type
attribute with value warning
- para[5][@type="warning"]
selects the fifth para
child of the context node if that child has a type
attribute with value warning
- chapter[title="Introduction"]
selects the chapter
children of the context node that have one or more title
children whose typed value is equal to the string Introduction
- chapter[title]
selects the chapter
children of the context node that have one or more title
children- employee[@secretary and @assistant]
selects all the employee
children of the context node that have both a secretary
attribute and an assistant
attribute- book/(chapter|appendix)/section
selects every section
element that has a parent that is either a chapter
or an appendix
element, that in turn is a child of a book
element that is a child of the context node.E
is any expression that returns a sequence of nodes, then the expression E/.
returns the same nodes in document order, with duplicates eliminated based on node identity.