Import to XML Builder
In this topic ...
Related Topics ...
The Import to XML builder adds a variable containing the contents of a Java properties file or an XML file to the model. The file can be specified in relative or absolute path, and its value can be loaded at execution time (by profile enabling a relative File Path input) or design time. The Factory servlet resolves any relative paths you specify from the Factory's WEB-INF directory.
For example, we can use the Import to XML builder to add the contents of an XML file as a variable or we can use the Import to XML builder to incorporate a property file for a Web application into your model as a variable.
The Import to XML builder reads in the properties and generates a variable in the model with a corresponding format. If the file contains XML, the variable maintains the XML structure. If the file is a Java properties file, the variable has an XML structure one level deep with the properties listed under the root element named <Configuration>. The name of the automatically created variable is the same as the Import to XML builder call name.
Quick Tip
- Do not use sibling XML nodes that have the same node name.
Specifying Inputs
The Import to XML builder takes the inputs described in the table below. For help on inputs common to many or all builders such as those in the Properties and HTML Attributes input groups, see "Using the Builder Call Editor."
Input name Description Name Enter a name for this builder call. The designer tool displays this name in the builder call list. Use Relative Path Select this option if the file path entered in the File Path field is a relative path. The file path is relative to the WEB-INF directory. File Path Enter a path to the configuration file. The file specified can be a relative or an absolute path, and its value can be loaded at execution time. File Format Select the type of file you want use to create a variable. We can select either XML File or Name/Value Properties File. Variable Schema Use the chooser to select a schema and element type with which to type the variable created by this Import to XML builder call. The Builder will infer type from the schema path to the data element you select with the picker.
Dynamically Update Enable this option if the file should be read every time the Factory servlet regenerates or loads the model. When you select this option, the variable is updated with the current contents of the specified file. Disable this option and the XML file is loaded only at regen or when the model changes.