Use Google to find help fast. For example, search on "xpressdox choosefromlist".

Understanding XpressDox Artefacts

Understanding XpressDox Artefacts

When a template runs, XpressDox creates a number of internal structures.  The most important of these is an XSLT Stylesheet.  The stylesheet contains the definition of how the data from an XML data set are to be inserted into the Word template in order to generate the merged document.  The stylesheet is constructed entirely from the contents of the XpressDox fillpoints in the template which is run (and in any templates included via «IncludeTemplate()» or «BaseTemplate()» commands).

The other important internal structure is the Schema.  This is created by XpressDox from the stylesheet.  The schema is used to construct the interview in the XpressDox desktop, and also in the browser version of XpressDox.

These internal structures are called “artefacts”, and for large templates the time taken to construct these artefacts can become unacceptably large.  And seeing that the artefacts will be exactly the same each time a template is run, it seems a pity to have to construct them each time.  For this reason XpressDox creates the artefacts only when the template is run for the first time, and after it (or any of its Included or Base templates) has changed.  The artefacts are stored in the “XDArtifacts” sub-folder of the template folder, with the same file name as the template, with the extension changing for each of the artefacts.  On the second and subsequent times that a template is run, instead of re-creating the artefacts, XpressDox reads them out of the XDArtifacts sub-folder. (The XDArtifacts folder is not shown in the XpressDox Explorer, as it would just create clutter).

In fact, on the second and subsequent runs of a template, the template file itself is not used by XpressDox, except that its time stamp is used to compare with the artefact’s time stamp to work out whether the template has changed since the time the artefact was created.

Suppress artefact creation

It might be that you (the template author) do not want the template artefacts created, for whatever reason (for small templates (less than about 10-20 pages) this will possibly not make a noticeable difference in execution time).  This can be achieved using the command «OptimizeParsing(Off)».

Restoring backups

When restoring a backed up version of a template, care must be taken to take the artefacts into account.  This can be done by restoring the backup of the artefacts (in the XDArtifacts folder), or by deleting the artefacts for the restored file.

The reason that this care must be taken is that, for reasons of efficiency, the way that XpressDox determines whether a template has changed since the artefacts were created is by comparing the “Date Modified” of the template with the date modified of the artefact.  In the case where a template is restored from a backup, that template’s date modified is highly unlikely to be later than the artefact files, and so when the template is next run, its contents will be ignored and the artefacts will used to create the interview and to perform the merge.  But the artefacts in this case will have been created from a later version of the template, not the one that was restored, and so restoring the backup of the template on its own, without restoring the backed up version of the artefacts (or deleting the artefacts), will have no effect.


Leave a Reply