开发者

XSL For-Each exclusion by ID

I've got an XSL issue.开发者_如何学Go With the following code I exclude Box1

<xsl:for-each select="//box[@id!='box1']">

But I also want to exclude Box7. Is that possible and how can I do that?


You can AND those predicates together:

<xsl:for-each select="//box[@id!='box1'][@id!='box7']">


Use:

//box[not(@id='box1') and not(@id='box2')]

If you have many ids to exclude, use (in this example I am excluding "box1" - "box4"):

//box[not(contains('|box1|box2|box3|box4|', concat('|', @id, '|'))]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜