transform fails in eclipse oxygen, but runs externally

Here should go questions about transforming XML with XSLT and FOP.
swwj3s
Posts: 3
Joined: Tue Feb 27, 2007 11:47 pm
Location: Austin, TX

transform fails in eclipse oxygen, but runs externally

Post by swwj3s »

I have a XSLT 2.0- stylesheet that uses a recursive template to run through many rows of a table (6000). The stylesheet works on several smaller files but fails on the large files.
The oxygen error:

Code: Select all

Too many nested apply-templates calls.  The stylesheet
may be looping.
The interesting part is this. The same stylesheet and source document work when I call Saxon8B directly using ant. I even use the saxon jar in the oxygen plugin directory.

I am not using the debugger because eclipse/oxygen can not open the large source file. Infinite Loop detection is turned off in the oxygen preferences.

Any ideas why this happens?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

Do you mean that the same stylesheet applied to the same XML input file works in Ant and ends with the error "Too many nested apply-templates calls" when you apply it in the editor perspective of oXygen? In that case the option "Infinite loop detection" has no effect because it is applied only to the debugger. Can you send us sample files for reproducing the problem?


Regards,
Sorin
swwj3s
Posts: 3
Joined: Tue Feb 27, 2007 11:47 pm
Location: Austin, TX

Yes.

Post by swwj3s »

The same stylesheet works in an ant script and fails in the oXygen perspective.
I just uploaded the stylesheet, ant file, nonworking source file, and a working source file.

Just FYI, the non-working source file is around 12MB uncompressed and does not open on my machine in oXygen.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

I think in your case the error message "Too many nested apply-templates calls. The stylesheet may be looping." means a stack overflow error due to a deep level of recursive calls. It happens with Saxon 8 for a level of 500 or more. You have to increase the memory of the stack size for the Java virtual machine that runs Eclipse using the -Xss parameter, for example -Xss1024k.

Eclipse cannot load a file of 12 MB. I tried to open your file with the built-in text editor of Eclipse and Eclipse reported an internal error so I had to close Eclipse. It was an OutOfMemoryError logged in the Eclipse log. You should open the file and do the transformation in oXygen standalone.


Regards,
Sorin
swwj3s
Posts: 3
Joined: Tue Feb 27, 2007 11:47 pm
Location: Austin, TX

works with increased stack size

Post by swwj3s »

I added -Xss2048k to eclipse.ini and restarted. The transformation works then.

I do not know if it possible to catch that overflow error, but a real error message would have saved me a ton of time! Hopefully, someone sees this post and it saves them some time.

I will download oXygen standalone and try it. All of our other development work is in eclipse, so it would be great to keep this work in the same tool/workspace.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Regarding the 12 MB file: try increasing the memory for Eclipse, to 512MB for instance using

-Xmx512m

in the virtual machine arguments in command line

eclipse.exe -vmargs -Xmx512m

Regards,
George
George Cristian Bina
Post Reply