As a follow up to my previous question, I am trying to really simplify several xml
templates extracted from .docx
files created in Word 2010 and used as subtemplates in OpenTBS in order to speed up my document creation. The subtemplates contain an mc:AlternateContent
block which is all I use in my main template, like this:
[LineItem.template;block=w:r;file='templates/[val].xml';getpart=(mc:AlternateContent)]
I noticed that multiple (20) large (>100KB) subtemplates can seriously affect OpenTBS' speed, so I would like to eliminate the code I am not using (outside of mc:AlternateContent). I am already planning on doing other processing on my templates through TBS and caching the simplified version, so it would be great if I could use OpenTBS' getpart functionality to pull this data from the larger template at the same time. Is this possible?
For instance, to be able to fit this (pseudo-) code into my processing:
foreach($templates as $template){ //loop through xml templates
$TBS->LoadTemplate($template);
$simpleTemplate = $template->getpart('mc:AlternateContent');
/*
/ simpleTemplate now holds all the xml inside the mc:AlternateContent tags
/ (everything that would have been included in my template had I used attribute
/ getpart=(mc:AlternateContent) in my file inclusion)
*/
$simpleTemplate->save('simple/'.$template);
}
P.S. Should I be asking this on the TBS forum instead?