Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 6th, 2006, 09:50 AM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saxon variable

Hi,
I'm doing some calculation with a Saxon variable, initial value = 0 (internal integer?):

<xsl:variable name="var" saxon:assignable="yes">0</xsl:variable>

I discovered problems when assigning values to a variable:

<saxon:assign name="var">
  <xsl:value-of select="0"/>
</saxon:assign>

Assigning and even XSL-'testing' against expression does not always seem to be working correctly (e.g. value will not be set to 0 and comparison with another value will not result in TRUE/FALSE).

Is there a general issue?

Ciao



 
Old July 6th, 2006, 10:12 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is a product-specific issue so it's best dealt with on the saxon-help list or forum at sourceforge.net. Please supply a complete stylesheet that demonstrates the problem, it's impossible to debug code when you only have fragments.

saxon:assign is a somewhat dubious extension because it breaks the declarative nature of the language, and there can certainly be cases where optimization of the surrounding code causes it not to behave in the way you might expect. The amount of rewrite optimization that Saxon is doing these days is steadily making this problem worse. There's usually a better way of coding the transformation.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference




Similar Threads
Thread Thread Starter Forum Replies Last Post
Saxon Parser ravi_sri24 XSLT 7 February 8th, 2008 06:25 AM
Saxon java question amhicraig XSLT 1 December 7th, 2007 01:21 PM
Saxon 9.0 question ojasrege XSLT 1 November 27th, 2007 06:32 PM
error on saxon 8.8 rjonk XSLT 1 October 24th, 2006 09:03 AM
SAXON Ques dev.user06 XSLT 4 July 26th, 2006 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.