开发者

How do i check if a node is a child of another node?

开发者 https://www.devze.com 2023-01-01 08:28 出处:网络
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 XP

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号