How do i check if a node is a child of another node?
I want to get all "g开发者_开发问答enerateId" values of the text nodes which are a child of a specific node whose attribute "id" value is known. I can i test for this condition using XSL?
Use an XPath 2.0 expression like this:
//specificNode[@id=$knownValue]/text()/generate-id(.)
You may also use keys (<xsl:key>
and the key()
function) for more efficient selection of all specificNode-s that have an id
attribute with a knownValue.
精彩评论