Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Problem with assigning value to variable

From: "Christian Barth" <christian@------------->
To:
Date: 3/1/2006 1:15:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent