Subject: Re: Multiple arguments in one test
From: Michael Dykman <mdykman@xxxxxxxxx>
Date: Tue, 16 Nov 2010 13:51:24 -0500
|
*[@outputclass='SupportInfo'][string() = 'Yes']
- md
On Tue, Nov 16, 2010 at 1:48 PM, <Sharon_Harris@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> How do I perform a test to find an element whose attribute value equals a
> specific value and if the element itself contains specific text? For
> example, I want to find a "p" element that has an "outputclass" attribute
> whose value is "SupportInfo" and when those conditions are met, does that
> "p" element contain the keyword "Yes". And once all of those conditions are
> met, then do something (for example, output "this works").
>
> XML snippet:
> -------------------
> <p outputclass="SupportInfo">Yes</p>
>
>
> I have tried combining all arguments into 1 test but the latter part of the
> test is ignored.
>
> XSLT snippet:
> ---------------------
> <xsl:choose>
> <xsl:when test="//@outputclass='SupportInfo' and contains(.,
'Yes')">
> <tr>
> <td class="info">
> <xsl:text>Print Supporting Information to
> PDF:</xsl:text>
> </td>
> <td>
> <a href="SupportEnterprise.pdf"
target="new">
> <img src="images/printer.gif"
alt="PDF
> version" border="none"/>
> </a>
> </td>
> </tr>
> </xsl:when>
> </xsl:choose>
>
> Thanks for your help!
> _______________________________
> Sharon Goldner Harris
> Content Management Evangelist
> Ultimate Software Group
> 704-660-6482
>
> Confidentiality Note: This e-mail message and any attachments to it are
> intended only for the named recipients and may contain legally privileged
> and/or confidential information. If you are not one of the intended
> recipients, do not duplicate or forward this e-mail message.
>
>
--
- michael dykman
- mdykman@xxxxxxxxx
May the Source be with you.
|