4D v16.3Exporting and importing structure definitions |
||
|
4D v16.3
Exporting and importing structure definitions
Exporting and importing structure definitions
4D lets you export the database structure definition as an XML or HTML file. Conversely, it is possible to use a structure definition saved in XML format to generate a new 4D database on the fly. These new possibilities meet different needs:
4D structure definitions are based on the XML format. You can display a structure definition using a simple text editor. The XML format also allows any type of use to be foreseen, in particular via XSL transformations. Moreover, 4D uses an .XSL file to export the structure definition in HTML format. A structure definition includes tables, fields, indexes and relations, along with their attributes and the various characteristics that are necessary for a complete definition of the structure. The internal “grammar” of 4D structure definitions is documented through DTD files — also used for the validation of XML files. 4D lets you export a structure in either XML or HTML format. Choose the format that best meets your needs:
To export a structure definition in XML:
To export a structure definition in HTML:
To generate the HTML pages of the structure definition, 4D carries out XSL transformations by default using the “Structure_to_html.xsl” file placed in the /Resource/language.lproj subfolder of the application. Note: If this file is not present, exporting in HTML is not available in the export dialog box. You can customize these transformations as desired using a custom XSL style sheet file. To do this, simply create a file named “Structure_to_html.xsl” file (you can duplicate the default file) and place it at the same level as the .4db file. 4D will then use this file to generate the structure definition in HTML format. Structure definitions that are exported in XML format can be used to create new identical databases on the fly. In this case, the structure definition can be considered as a structure template, which it is possible to duplicate at leisure. An XML structure definition can be used as such or can be modified beforehand via an XML editor. This means that the use of any type of mechanism used to generate structures by programming can be considered. Furthermore, since the internal format of 4D structure definition XML files is public (see the “Format of a 4D structure definition” section above), it is possible to build this type of file from other database environments or any design application in order to generate 4D databases automatically. To create a database from a structure definition:
|
PROPERTIES
Product: 4D
HISTORY
ARTICLE USAGE
4D Design Reference ( 4D v16) |