Template processing flow specifics
The template handler is responsible for parsing and transforming a template into a partial label which is then handed over to be further populated by the invoking processor. In brief, the handler will perform the following (pre-processing) steps before handoff:
- parse the template elements depth-first in document order
- evaluate each element's declared and inherited properties to construct its effective state (and ensure its validity)
- construct and attach any duplicated subtrees (multior pluralsourcesconditions)
- while visiting each element:- execute fetchif present
- execute fillif present and notdeferred
- record any deferredfills or non-fetchrequiredconditions for evaluation during post-processing
 
- execute 
After the invoking processor has populated the remaining elements of the partial label, 
control is handed back to the template handler as part of the label export process 
(i.e. Template.export(...)), where the following (post-processing) steps occur:
- execute any recorded deferredfills
- evaluate any non-fetchrequiredconditions; prune eligible optional elements from the document tree
- ensure all remaining elements are populated
- if indicated: ensure the structure of the partial label has not been altered by the invoking processor after handoff (e.g. the processor hasn't slyly added in a class)
- remove unused namespace declarations (including the PT namespace)
- export the label