user2423959
user2423959

Reputation: 834

or condition not working as expected

I've the below XML statement

<section level="sect1">
    <title><content-style font-style="bold">PRACTICE DIRECTIONS</content-style></title>
</section>

when i try to apply the below condition

<xsl:when test="not(contains(./title/content-style/text(),'PRACTICE DIRECTIONS'))">
<xsl:choose>
    <xsl:when test="./section[1]/para/phrase">

        <xsl:value-of select="./section[1]/para[1]/phrase"/>

        <xsl:for-each select="./section">
            <xsl:apply-templates select="." mode="toc"/>    
        </xsl:for-each>
    </xsl:when>
</xsl:choose>

It is working fine

Here I've another condition.

<xsl:when test="not(contains(./title/content-style,'ORDER')) or not(contains(./title/content-style/text(),'PRACTICE DIRECTIONS')) or not(contains(./section[1]/title,'ORDER')) or not(contains(./section[1]/title,'PRACTICE DIRECTIONS'))">

Here this should not let the condition(or the cursor) to get into the inner choose condition as there is not(contains(./title/content-style/text(),'PRACTICE DIRECTIONS')) as one of the conditions.

But here in my case the cursor is moved into the inner choose. Where am I going wrong?

Upvotes: 0

Views: 50

Answers (1)

Tobberoth
Tobberoth

Reputation: 9527

Use AND instead of OR and you'll probably get the result you're after.

Upvotes: 1

Related Questions