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 » Tue Jan 16, 2007 4:36 pm

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 » Tue Jan 16, 2007 4:53 pm

The problem seems to have resolved itself. Sorry if anyone spent any time looking for a solution!

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Strange xsl:variable problem

Post by sorin_ristache » Tue Jan 16, 2007 6:40 pm

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 » Tue Jan 16, 2007 6:58 pm

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: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Wed Jan 17, 2007 10:35 am

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 » Wed Jan 17, 2007 10:43 am

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