[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: assigned variable value is changing
Ganesh Babu N wrote:
In the Name attribute i am capturing column number: row number. 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 R2</entry> so @namest is an empty sequence and that way the check contains(preceding-sibling::entry[1],@namest) gives true as for the contains 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/
|
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
|