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

AW: Variables

Subject: AW: Variables
From: Markus Abt <abt@xxxxxxxx>
Date: Thu, 7 Aug 2003 14:43:36 +0200
xsl if comparing variables
Hi, it's

<xsl:for-each
	select="Key_Group_Member_Groups/Key_Group_Member/Key_Group_MemberProps">
	<xsl:variable name="kid" select="Key_Group_Member_Column" />

	<xsl:for-each select="../../../../../Attribute_Groups/Attribute">
		<xsl:if test="@id=$kid">
							
			<xsl:value-of select="@Name" />
			<br/>

		</xsl:if>
	</xsl:for-each>
</xsl:for-each>

or simply

<xsl:for-each
	select="//Key_Group_Member_Groups/Key_Group_Member/Key_Group_MemberProps">

	<xsl:for-each select="../../../../../Attribute_Groups/Attribute[@id=current()/Key_Group_Member_Column]">
							
		<xsl:value-of select="@Name" />
		<br/>

	</xsl:for-each>
</xsl:for-each>


$aid=$kid is of course constant and happens to be false in your example.

Regards,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de


----------
Von: 	AROSO Jose Antonio
Gesendet: 	Donnerstag, 7. August 2003 13:14
An: 	'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Betreff: 	RE:  Variables

<xsl:for-each
select="Key_Group_Member_Groups/Key_Group_Member/Key_Group_MemberProps">
		<xsl:variable name="kid" select="Key_Group_Member_Column" />

		<xsl:variable name="aname"
select="../../../../../Attribute_Groups/Attribute/@Name" />

		<xsl:variable name="aid"
select="../../../../../Attribute_Groups/Attribute/@id" />
							
							
		<xsl:for-each select="$kid">
			<xsl:if test="$aid=$kid">
								
							
				<xsl:value-of select="$aname" />
				<br/>
	

	

			</xsl:if>
		</xsl:for-each>

Ok.
I would try to explain better.

In the attribute node i have the id and the name of the attribute.

In this if control: <xsl:if test="$aid=$kid"> i compare the aid variable
with the kid variable. If it´s true i print the content of the aname
variable. But the aname variable(name of attribute) can dont correspond with
the attribute id(aid).
How can i solve it?  


-----Original Message-----
From: Michael Kay [mailto:mhk@xxxxxxxxx]
Sent: quinta-feira, 7 de Agosto de 2003 11:57
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Variables


> I need to do a loop and at the same time i need the two 
> values(id and name). So i would like to put in one variable 
> the two values for access to id for compare and if the 
> compare is true print the name.

I'm sorry, but if that's a requirements specification then I've seen
better ones from marketing departments.

Michael Kay



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

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



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


Current Thread
  • AW: Variables
    • Markus Abt - Thu, 7 Aug 2003 08:50:57 -0400 (EDT) <=

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.