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

Re: assigned variable value is changing

Subject: Re: assigned variable value is changing
From: Ganesh Babu N <nbabuganesh@xxxxxxxxx>
Date: Mon, 3 Aug 2009 20:10:57 +0530
Re:  assigned variable value is changing
Why the 2nd test is not working. why the first test only working. How
to get correct number from 4th cell instead of NaN.


On Mon, Aug 3, 2009 at 4:46 PM, Martin Honnen<Martin.Honnen@xxxxxx> wrote:
> Ganesh Babu N wrote:
>> In the Name attribute i am capturing column number: row number.
>> Check the row[2]. In that we are having only 2 <entry>s instead of 3
>> because of the colspan.
>> So in my output i am increasing the column number of the 2nd <entry>
>> by the colspan value.
>> so for 2nd entry the value of @Name  is 2:1
>> Up to here the code is working correctly. after that in the column
>> number i am getting NaN. Even though i have included test conditions.
> That test is below:
>>>>                               <xsl:if
>>>> test="contains(preceding-sibling::entry[1],@namest)">
>>>>                                       <xsl:value-of select="$colc - 1 +
>>>> number(substring-after(preceding-sibling::entry[1]/@nameend,'c')) -
>>>> number(substring-after(preceding-sibling::entry[1]/@namest,'c'))"/>
>>>>                               </xsl:if>
>>>>                               <xsl:if
>>>> test="not(contains(preceding-sibling::entry[1],@namest))">
>>>>                                       <xsl:value-of select="$colc - 1"/>
>>>>                               </xsl:if>
>>>>                               <xsl:text>:</xsl:text>
>>>>                               <xsl:value-of select="$rowc - 1"/>
>>>>                       </xsl:attribute>
> The fourth 'entry' element looks like this:
>                    <entry align="left" valign="top">Table 1 TH C1
> so @namest is an empty sequence and that way the check
> contains(preceding-sibling::entry[1],@namest) gives true as for the
> function the empty sequence is interpreted as an empty string and for the
> second argument being the empty string contains gives true.
> So for that 'entry' the template tries to compute
>  number(substring-after(preceding-sibling::entry[1]/@nameend,'c'))
> which gives NaN as preceding-sibling::entry[1]/@nameend is the empty
> sequence, that way substring-after gives an empty string and number('')
> gives NaN. That way the whole expression gives NaN.
> --
>        Martin Honnen
>        http://msmvps.com/blogs/martin_honnen/

Current Thread


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.
First Name
Last Name
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.