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

determine if atleast one element equal to a particular

Subject: determine if atleast one element equal to a particular value
From: Prakash R <raghits@xxxxxxxxx>
Date: Thu, 8 Sep 2005 15:37:25 -0700 (PDT)
if atleast
I have an xml document which looks like this:

<products>
	<product>
		<name>shirt</name>
		<metadata fieldid="1">
			<fieldvalue>long sleeve</fieldvalue>
			<metadata fieldid="2">
				<fieldvalue>red</fieldvalue>
				<metadata fieldid="3">
					<fieldvalue>RG</fieldvalue>
				</metadata>
				<metadata fieldid="5">
					<fieldvalue>1</fieldvalue>
				</metadata>
			</metadata>
		</metadata>
		<metadata fieldid="1">
			<fieldvalue>short sleeve</fieldvalue>
			<metadata fieldid="2">
				<fieldvalue>blue</fieldvalue>
				<metadata fieldid="3">
					<fieldvalue>RG</fieldvalue>
				</metadata>
				<metadata fieldid="5">
					<fieldvalue>1</fieldvalue>
				</metadata>
			</metadata>
		</metadata>
		<metadata fieldid="1">
			<fieldvalue>sleeveless</fieldvalue>
			<metadata fieldid="2">
					<fieldvalue>red</fieldvalue>
				<metadata fieldid="3">
					<fieldvalue>LN</fieldvalue>
				</metadata>
				<metadata fieldid="5">
					<fieldvalue>1</fieldvalue>
				</metadata>
			</metadata>
		</metadata>
	</product>
	<product>
		<name>t-shirt</name>
		<metadata fieldid="1">
			<fieldvalue>long sleeve</fieldvalue>
			<metadata fieldid="2">
				<fieldvalue>red</fieldvalue>
				<metadata fieldid="3">
					<fieldvalue>AA</fieldvalue>
				</metadata>
				<metadata fieldid="3">
					<fieldvalue>BB</fieldvalue>
				</metadata>
			</metadata>
		</metadata>
		<metadata fieldid="1">
			<fieldvalue>short sleeve</fieldvalue>
			<metadata fieldid="2">
				<fieldvalue>blue</fieldvalue>
				<metadata fieldid="3">
					<fieldvalue>CC</fieldvalue>
				</metadata>
				<metadata fieldid="3">
					<fieldvalue>DD</fieldvalue>
				</metadata>
			</metadata>
		</metadata>
		<metadata fieldid="1">
			<fieldvalue>sleeveless</fieldvalue>
			<metadata fieldid="2">
					<fieldvalue>red</fieldvalue>
				<metadata fieldid="3">
					<fieldvalue>AA</fieldvalue>
				</metadata>
				<metadata fieldid="3">
					<fieldvalue>EE</fieldvalue>
				</metadata>
			</metadata>
		</metadata>
	</product>
</products>

Is there any way in xsl to determine if atleast one of
the fieldvalue of metadata with fieldid=5 is 1
i.e.
<xsl:if test="any(metadata[@fieldid=5]/fieldvalue) =
1">
</xsl:if>

Thank you.
Prakash

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.