Too many nested apply-templates calls

Here should go questions about transforming XML with XSLT and FOP.
msarrel
Posts: 10

Too many nested apply-templates calls

Sat Sep 17, 2016 11:13 pm

Hi,

I'm getting the error message "Too many nested apply-templates calls" when I try to transform my DocBook file to HTML using your unmodified DocBook HTML transformation scenario. I followed the directions here:

https://www.oxygenxml.com/doc/versions/ ... chers.html

to increase the amount of memory with -Xmx. I tried values up to -Xms14000m, I have 16 GB of physical RAM in my machine, but cannot transform successfully.

I'm using Oxygen 18.0, on a Mac with OS X 10.11.6. I run Oxygen by clicking on the icon in the Finder. My file is not really that large, just 547 kB, and about 5300 lines of DocBook XML. There are no images in the file. But, there are several large tables, hundreds to thousands of rows. Unfortunately, I can't share the document outside my company.

Do you have any ideas?

Best Regards,

Marc
msarrel
Posts: 10

Re: Too many nested apply-templates calls

Sat Sep 17, 2016 11:14 pm

Of course, I meant -Xmx14000.
adrian
Posts: 2442

Re: Too many nested apply-templates calls

Mon Sep 19, 2016 9:31 am

Hi,

First, giving a Java application (like Oxygen) 14GB of memory out of a total of 16GB system memory, is a bad idea. We recommend using at most half of the system memory, or 3/4 in extreme situations (need to transform huge files). In your case, 8GB recommended vs 12GB in the extreme scenarios.

Second, "Too many nested apply-templates calls" cannot be resolved by increasing the memory, because it's not a memory problem, it's either a masked stack overflow error, or an imposed limitation of the XSLT transformer. I would suggest reverting the memory configuration settings you made (-Xms and -Xmx) and letting Oxygen use the defaults.
In this case it's most likely a masked stack overflow error that should be worked around by increasing the stack size (-Xss) to 4MB. Try setting a new VM option with the value -Xss4m. You can try to slowly increase this to larger values (e.g. -Xss5m or -Xss6m). Note that this consumes memory on a per thread basis (Oxygen can have tens of threads), so using a very large value here can backfire and leave the application without memory.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
msarrel
Posts: 10

Re: Too many nested apply-templates calls

Mon Sep 19, 2016 8:42 pm

Thank you. I set -Xss4m and that solved the problem.

Regards,

Marc

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests