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

AW: Problem with assigning value to variable

Subject: AW: Problem with assigning value to variable
From: "Christian Barth" <christian@xxxxxxxxxxxxx>
Date: Thu, 2 Mar 2006 09:48:25 +0100
christian barth
Ok, I solved the problem. Quick and dirty. But anyway, here it is:

<xsl:if test="contains(string($bauteil_test),'true')">

I just test, if the variable-Value contains the String "true". So it doesn't
matter, if the value is "truetrue" or "truetruetrue" or anything else.


Greets,

Barthi

> -----Urspr|ngliche Nachricht-----
> Von: Christian Barth [mailto:christian@xxxxxxxxxxxxx]
> Gesendet: Mittwoch, 1. Mdrz 2006 14:15
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff:  Problem with assigning value to 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

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.