[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 20:13, henry human wrote:
Hi I have a for-each loop inside for-each I try to test a variable: Sorry, I can't work out what your question is. Your code fragments below dont't have an xsl:if aand you gove no indication what you intend then to produce. (It is very hard to guess as they are so convoluted. That defines foo to be an empty string, butit doesn't matter what it defines it to be as you immediately discard this variable and over-write it with another one with the same name://if statement <xsl:if test="$foo = 1"> //do nothing <xsl:variable name="foo"> <xsl:for-each select="data"> <xsl:choose> <xsl:when test="contains(elements/elementA '1234)"> that defines $foo to be a document node with a sing;e text node child that is a sequence of 1s and 0s. Unfortunatelly the value of the varable foo is either 001 , 011,00011 and so one That is what I'd expect, but yu don't say what you want it to be. and the if statement works never correct ! There is no if? I even defined the varable as a xs:integer type or as below , but ever the value is never a 1 or 0
|
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
|