This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

When test expression



I have a template with logic:

   <SPAN>
      <xsl:choose>
         <xsl:when test="A/B">
            <xsl:value-of select="A/B"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:node-name/>
         </xsl:otherwise>
      </xsl:choose>
   </SPAN>

to process a document like:

   <Apple>
      <A>
         <B>Red</B>
      </A>
   </Apple>
   <Kiwi>
      <A>
      </A>
   </Kiwi>
   <Orange>
      <A>
         <B></B>
      </A>
   </Orange>

which produces:

   <SPAN>Red</SPAN>
   <SPAN>Kiwi</SPAN>
   <SPAN></SPAN>


I'd like to have the test for A/B only succeed when the
value of the B node is not "" (producing <SPAN>Orange</SPAN>
in the example).

I've tried

   <xsl:when test="A/B[not(.)]"/>

but this does not work. Any suggestions?


Thanks for your time,

Paul	

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]