Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2006, 10:18 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 131
Thanks: 10
Thanked 0 Times in 0 Posts
Default Element test

Hi,

How do I test for each occurence of 'Test Code' where Code is equal to any value?

For example:
Code:
<Test Code="0005">
....
</Test>
<Test Code="0008">
....
</Test>
<Test Code="0011">
....
</Test>
Thanks in advance,


Neal

A Northern Soul
__________________
Neal

A Northern Soul
 
Old June 12th, 2006, 10:44 AM
Authorized User
 
Join Date: Jun 2006
Posts: 22
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Code:
<xsl:value-of select="Test[Code='0005']" />
 
Old June 12th, 2006, 11:00 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 131
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Sorry,

No, I meant where the value is unknown.

I think it is

<xsl:value-of select="@Code"/>

Thanks anyway,


Neal

A Northern Soul
 
Old June 13th, 2006, 05:54 AM
Authorized User
 
Join Date: Jun 2006
Posts: 22
Thanks: 2
Thanked 0 Times in 0 Posts
Default

oh, sorry I'm still not sure what you mean though.

I'm quite new to XSL but feel I'm kind of getting there..

I use the @ when testing for a certain value.. eg.

Code:
<xsl:if test="Test/@Code = '0005'">
...found it!!!
</xsl:if>
Hope that helps, if you've not already got the answer..






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding element to the previous element dani1 XSLT 5 September 10th, 2008 01:38 AM
test test Crystal Reports 0 August 21st, 2007 01:35 PM
translate element name to element name lexzeus XSLT 3 September 4th, 2006 09:04 AM
adding of element and assigning to one element sushovandatta XSLT 2 November 16th, 2004 07:04 PM
How do I test for an empty array element kmoran Excel VBA 1 October 8th, 2004 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.