Project

Profile

Help

updatable variables in {} braces. bug?

Added by Anonymous over 17 years ago

Legacy ID: #4032816 Legacy Poster: Glen (glen_dc)

Possibly bug. Looks like Saxon does not resolve updatable variable in {} braces -- it uses the initial value of the variable In my xsl I have an Saxon-updatable variable and loop through images. I want to generate several gallery pages with given number of images per page. <saxon:assign name="current_page" select="1"/> <xsl:for-each select="gallery/images/image[ (position() mod $images_per_page) = 1]"> ... ... this DOES NOT work. The generated link is always all-0.html <a href="all-{$current_page - 1}.html">prev</a> ... this is work around -- create a non-Saxon-updatable local variable <xsl:variable name="current_page_local" select="$current_page"/> <a href="all-{$current_page_local - 1}.html">prev</a> ... creates all-0.html, all-1.html, all-2.html... <saxon:assign name="current_page" select="$current_page+1"/> ... </xsl:for-each> The same problem with <xsl:result-document>. This works: <xsl:result-document href="all-{$current_page_local}.html" method="html"> and this <xsl:result-document href="all-{$current_page}.html" method="html"> does not work. It always tries to output to the all-1.html and on attempt of reopen all-1.html on the second step though the for-each loop. Glen


Replies (1)

RE: updatable variables in {} braces. bug? - Added by Anonymous over 17 years ago

Legacy ID: #4034267 Legacy Poster: Michael Kay (mhkay)

Any chance you could send me a working repro please? I wasn't able to reproduce it, but that doesn't mean there's no bug. Feel free to post it directly to mike at saxonica.com if you don't want to make it public. Also, can you confirm this is on Saxon 8.8?

    (1-1/1)

    Please register to reply