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

Problem with assigning value to variable

Subject: Problem with assigning value to variable
From: "Christian Barth" <christian@xxxxxxxxxxxxx>
Date: Wed, 1 Mar 2006 14:15:06 +0100
value variable
Hi List!

<xsl:for-each
select="/tamino-result/Bs_Bauteil_Liste[@gebaeude_id=$gebId]/Brandwand_Liste
/Brandwand[funktion='Trennwand']">
 <xsl:sort select="." order="ascending" data-type="text"/>
 <xsl:variable name="ID" select="@ID" />
 <xsl:variable name="bez" select="bezeichnung" />
 <xsl:variable name="wand_ID" select="Wand_id_Liste/wand_id"/>
 <xsl:variable name="bauteil_test" >		<!-- Pr|ft, ob das Bauteil
im aktuellen Stockwerk Teil der Trennwand ist. Nur dann wird diese in den
Baum eingef|gt. -->
   <xsl:for-each
select="/tamino-result/Gebaeude[@ID=$gebId]/Stockwerk_Liste/Stockwerk[@ID=$s
tock_ID]//bauteil_id">
     <xsl:if test="string(.) = string($wand_ID)">
       <xsl:text>true</xsl:text>
     </xsl:if>
   </xsl:for-each>
 </xsl:variable>
 <xsl:if test="$bauteil_test = 'true'">
	DO SOMETHING
 </xsl:if>
</xsl:for-each>

The Element Trennwand consists of several wand-Elements with a wand_id.
These wand-Elements are children of bauteil-Elements with a bauteil_id.
So wand_id and bauteil_id are the same.
With the above code I  want to test, if a Trennwand has a wand_id same as
the bauteil_id in a specific Stockwerk. So I can find out, in which
Stockwerk the Trennwand is located.
The problem is, that these bauteil_ids exist several times in every
stockwerk.
Now, the code it self is working, but I have a problem with the variable
bauteil_test.
In my example the bauteil_id exists three times in the Stockwerk. So the
result of the variable is:

<xsl:variable name="bauteil_test" >truetruetrue</xsl:variable>

But what I want is:

<xsl:variable name="bauteil_test" >true</xsl:variable>


How can I do this??

I hope someone understood my problem.

Thanks,
Barthi

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.