[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Multiple arguments in one test

Subject: Multiple arguments in one test
From: Sharon_Harris@xxxxxxxxxxxxxxxxxxxx
Date: Tue, 16 Nov 2010 13:48:00 -0500
 Multiple arguments in one test
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.