[j-nsp] Commit script: xsltMaxDepth
Serge Vautour
sergevautour at yahoo.ca
Wed Jun 1 15:28:53 EDT 2011
Hello,
I'm getting this error when I run a commit script I've written:
re0:
error: runtime error: file /var/db/scripts/import/junos.xsl line 100 element
param
error: xsltApplyXSLTTemplate: A potential infinite template recursion was
detected.
You can adjust xsltMaxDepth (--maxdepth) in order to raise the maximum number of
nested template calls and variables/params (currently set to 3000).
I'm not a programmer but can usually find a way to code what I want. I've
written a few basic commit & event scripts and they work. This one is getting
very long - lots of for-each loops inside loops. This is mostly because I can't
find a way to store data in a hash in reference that data later (that's what I
would do in perl).
I had this script working by parsing an apply macro:
apply-macro slot-type {
0 dpc;
1 dpc;
7 mpc;
}
I would like to replace the macro with a "get-chassis-inventory" call in the
script so that I don't have to manually update the macro when cards change. I
have get-chassis-inventory working on it's own but when I merge it with my other
script, it clearly adds to many loops when it parses every single card over and
over.
Can anyone suggest a way to solve the problem above? Is there a way to have a
separate commit script to maintain the apply-macro? Is there a way to creates
hashes in slax? I don't expect to be able to change the xsltMaxDepth.
I can post the script if someone wants to see it. Since I'm not the best
programmer, I tend not to make my code public.
Thanks,
Serge
More information about the juniper-nsp
mailing list