[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: update value of variable in for-each loop
On 08/04/2014 21:18, henry human wrote:
sorry Michael, David I was little bustling! hope this below is more clear now. The varable value should be updated This variable isn't used. <xsl:for-each select=bpartiotion/files/file[@name=bxxb or name=bxyb or name=basdb or b&b&b&.. b> <xsl:variable name="foo"> <xsl:for-each select="data"> <xsl:choose> <xsl:when test="contains(elements/elementA '1234) or contains(elements/package/id '55) or contains(elements/category/id, '67)" or contains(b&b&b&b&."> This variable is only used once, on the line below so really no point in havin it, as mentioned before $foo will be a document node with a text node child that is a sequence of 0 and 1.
So it will only be equal to 1 if all but the last value in the loop above gave 1 ir if $foo is 0000000000000000000001 But it seems a pretty strange thing to be testing.
As a wild guess, perhaps you didn't want any variable at all and wanted all of the above replaced by <xsl:if test="(partiotion/files/file[@name=bxxb or name=bxyb or name=basdb or b&b&b&.. )/ data/(contains(elements/elementA '1234) or contains(elements/package/id '55) or contains(elements/category/id, '67)" or contains(b&b&b&b&.))"> do something </xsl:if> David -- google plus: https:/profiles.google.com/d.p.carlisle
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|