• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

JDE Embedded BIP - Import subtemplate using a variable name instead of hard coding it

JDE kid

Member
Hi,

I have a need to Dynamically call (import) RTF sub-templates based on the file path/name coming in from the xml data. Is there a way to do this?

The following works:
<?import:file:///C:/temp/SubTemplate.rtf?>
<?call-template:message2?>


The following errors. How do I do import a sub template using a variable name in the import??
I am probably just missing the syntax somewhere when I use var1 in the import.
<?xdoxslt:set_variable($_XDOCTX, 'var1', '///C:/temp/SubTemplate.rtf')?>
<?import:file:var1?>
<?call-template:message2?>


Thanks,
JDE Kid
Applications Release - 9.2
Tools Release - 9.2.2.2
BIP Word Plugin Version - 11.1.1.7 (Build 11.117.0.79)
Microsoft Word 2013 64 Bit


 

jileto

Well Known Member
No you can't. The imported subtemplates are loaded by the template pre-processor. If you're a C programmer, you can think of the RTF subtemplates as header files and the "import" as C's "#include".

The BIP pre-processor is still building the final code during pre-processing. That's why you can't use variables.

Have you tried using subtemplates that accept parameters?
 
Top