In order to design your template (form) you will normally need at least one sample XML file, that you want to merge the template with. The XML file(s) must be placed in the /resources/document directory (or a subdirectory inside of this) inside the InterFormNG_Home directory.
You can import an XML file into the template, if you open the template and select Import, XML documents and click this icon:
Now you are asked for the XML file, that you want to import:
The icons on the right are:
Opens an XML file inside the {InterFormNG_Home}/resources/document - or subfolder.
Opens the XML file in your preferred editor. The changed XML file is reloaded within a couple of seconds after you have saved the changes.
Reloads the template and any referred resource. If you have changed an XML file with the icon above, then you might need to reload before the output is updated - if you are using subtemplates.
As default InterFormNG assumes, that you want to import a primary XML file. If you only want to refer to a single XML file within the template, then it should be a primary XML file. This will be the file, that is substituted when you use the Service to automatically merge incoming XML files with a template.
Apart from the primary file, you can also (via Classification) refer to one or more secondary xml files e.g. to add extra information not found in the primary, trigger file or to merge XML files created by different applications. The secondary files can be fixed, or selected as a Dynamic file depending on the contents of the primary file. Here we select a dynamic secondary file, where we use an Xpath expression (where we refer to the contents of the primary file) to build on the path and file name:
In this example the Xpath expression is: concat(“/intro/”,/Document/DocumentNo,”.xml“), where DocumentNo can e.g. be ‘1004' causing the file /intro/1004.xml to be selected as the secondary file referred to as ‘Dynamic1' in the template when using an xml cursor.
Another example showing the use of multiple XML files is included below.