Strange xsl:variable problem

Oxygen general issues.
heavydawson
Posts: 14
Joined: Wed Sep 20, 2006 7:07 pm

Strange xsl:variable problem

Post by heavydawson »

I have a piece of pretty standard xslt that is causing me problems.

Code: Select all

<xsl:variable name="line-rate" select="round-half-to-even(@line-rate * 100, 2)"/>
<xsl:variable name="dave" select="round-half-to-even(@line-rate * 100, 2)"/>
When I debug this code, I can see in the debugger that the line-rate variable has been set correctly, while the dave variable exists but it not set. The lines come directly after each other in the stylesheet. How can it be that one functions correctly and the other not, when the xpath expression is the exact same?

The code is stylesheet is defined as xslt 2.0, and I'm using saxon 8, and my jre is 6.0
It may or may not be related but just today Oxygen started throwing an error on load

Code: Select all

[ AWT-EventQueue-0 ]  -  java.lang.NullPointerException
java.lang.NullPointerException
at ro.sync.ui.application.ApplicationDialog.ʗ(Unknown Source)
at ro.sync.ui.application.ApplicationDialog.setVisible(Unknown Source)
at ro.sync.I.K.ل(Unknown Source)
at ro.sync.I.K$3.run(Unknown Source)
at ro.sync.ui.H$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
However, it continues to load fine. Can anyone help me?
heavydawson
Posts: 14
Joined: Wed Sep 20, 2006 7:07 pm

Post by heavydawson »

The problem seems to have resolved itself. Sorry if anyone spent any time looking for a solution!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Strange xsl:variable problem

Post by sorin_ristache »

heavydawson wrote:When I debug this code, I can see in the debugger that the line-rate variable has been set correctly, while the dave variable exists but it not set. The lines come directly after each other in the stylesheet. How can it be that one functions correctly and the other not, when the xpath expression is the exact same?

...

It may or may not be related but just today Oxygen started throwing an error on load
No, they are not related. The NullPointerException error is caused by a bug in the window support of the JVM but it does not occur often. Is the dave variable used in the stylesheet, for example in an xsl:value-of element ? If it is only declared in the stylesheet then Saxon does not evaluate it.


Regards,
Sorin
heavydawson
Posts: 14
Joined: Wed Sep 20, 2006 7:07 pm

Post by heavydawson »

I had used an <xsl:value-of> to print the value, but it wasn't working. It seemed to be some spurious problem, as it has now resolved itself, without me changing anything.

The Oxygen startup error occured seemingly when my browser (Firefox) was running a Java applet at the same time. Again, I'm not sure if they're related, but the problem stopped once I closed Firefox (and as a result, the JVM instantiated by Firefox)
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

heavydawson wrote:I had used an <xsl:value-of> to print the value, but it wasn't working. It seemed to be some spurious problem, as it has now resolved itself, without me changing anything.
If you can reproduce the problem please post a sample stylesheet.


Regards,
Sorin
heavydawson
Posts: 14
Joined: Wed Sep 20, 2006 7:07 pm

Post by heavydawson »

I haven't seen the problem for a while. I'll try and reproduce it if I can.
One thing I should say was that the system is a pretty low spec one.
There's only 512MB of RAM, and it swaps almost 99% of the time even when switching windows.
I think the problem appeared to go away when I closed a few programs and re-opened Oxygen. However, I'll continue to try and reproduce the problem and post a sample stylesheet if I can.
Post Reply