开发者

Simple question about boolean operator in XSLT

The XML file I want to extract data from looks as below:

`<groups>
  <group>approved</group>
  <group>withdrawn</group>
</groups>`  

I am using 'if' state开发者_如何学Pythonment on this part of code to give me the data only if it is approved and don't give me the data if it has both groups(approved and withdrawn). I tried doing something but its not giving me the output. I tried the following:

<xsl:if test="groups/group='approved' and group!='withdrawn'">
<xsl:value-of select="name"/><xsl:text>

I also tried other things, but couldn't really get there. If anyone can help me with this simple question that will be really great. Thank you.


I am using 'if' statement on this part of code to give me the data only if it is approved and don't give me the data if it has both groups(approved and withdrawn).

I guess that you're looking for something like:

<xsl:if test="groups/group='approved' and not(groups/group='withdrawn')">
    <!-- some stuff -->
</xsl:if>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜