LoadOnce Element (Data)
Context: HL Kit … Kit Reference … Data File Reference
The "loadonce" Element
The loadonce element has the following attributes:
key Key – Specifies a unique text key for the file. Only one file will ever be loaded for any given key.
If a "loadonce" element is found at the top of a file, the file is only parsed if another file with the same key has NOT been loaded. If a file with that key has already been loaded, the contents of the file are totally ignored.
If two or more files have the same loadonce element, exactly one of them will be loaded, with no guarantee of which one it will be. Don't assume anything about which file of a pair will be loaded - for example, on one computer, file A might be loaded and file B skipped, while on another computer file B might be loaded and file A skipped.
Example
If two files had the following loadonce elements, only a single one of them would be loaded:
File A: <loadonce key="Source Definition File"/> File B: <loadonce key="Source Definition File"/>
If four files had the following loadonce elements, file A would be loaded and only one of file B, C or D would also be loaded:
File A: <loadonce key="Source Definition File"/> File B: <loadonce key="Other Definition File"/> File C: <loadonce key="Other Definition File"/> File D: <loadonce key="Other Definition File"/>