I'm having trouble referring to tDOM objects in a tcl page that are created on server load in a -procs.tcl file. Does anyone have experience with this?
In summary, I want to:
- Pre-parse an XSL document using tDOM in a -procs.tcl file
- Use that pre-parsed document multiple times in a .tcl file
Here's what I'm doing:
I'm testing the speed benefits of using XSL transforms on some heavily loaded pages over using the templating system (short story, yes, it will be much faster, but not clear how useful it is a general templating solution).
I realized after some load testing that it would be preferable to load the XSL on server load (in packages/acs-templating/tcl/xsl-procs.tcl), and create the XSLTcmd proc then. This would cut out a lot of processing, esp. since the XSL is fairly long.
This is where I get stuck: I can't seem to access the ref'ed proc after the server loads the file. Here's my code:
set template_index_xsl "<blah XML>"
dom parse $template_index_xsl temp_xsl_doc
$temp_xsl_doc toXSLTcmd template_index_xsl_compiled
nsv_set xsl_templates index $template_index_xsl_compiled
This puts a variable something like XSLTcmd0x292929 in the nsv array. The problem is the proc named XSLTcmd0x293939 doesn't seem to be available from any of my tcl scripts. I've double checked namespaces, and I'm certain that I'm referring to the command correctly.
Can anyone explain just what's happening here, or provide any direction?
Thank you!