ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL
  • Overview
  • Operations in the data model editor
  • Importing an XML document
  • Generating the analysis
  • Use through programming
  • Browsing the different files of XML document
  • Limitations
  • Queries
  • Creating files
  • Filter
  • Reading XML files
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Native XML Connector
Native Connectors (Native Accesses)Available only with this kind of connection
Warning
From version 27, it is no longer possible to import XML files into the analysis. To handle XML files, it is recommended to use variables of type xmlDocument. For more details, see Management of XML.
Overview
WINDEV and WEBDEV allow you to import and handle a definition of XML files via the data model editor.
The method for handling the XML files is the same as the method for handling the standard HFSQL data files.
Operations in the data model editor

Importing an XML document

To import the structure of an XML document into the data model editor:
  1. In the data model editor, start the import wizard: on the "Analysis" tab, in the "Creation" group, expand "Import" and select "Import file/table descriptions...".
  2. In the wizard that starts:
    • Specify the database type: XML
    • Specify whether the data must be migrated to the HFSQL Classic format.
    • Specify the path of the XML document to import.
    • Select the tables of the XML document to import.
  3. Finish the wizard: the different files found in the XML document and their tree structure are automatically represented in the data model editor.

Generating the analysis

To create windows or pages that handle the XML document described in the analysis, the analysis must be generated: on the "Analysis" tab, in the "Analysis" group, click Generation icon.
Use through programming

Browsing the different files of XML document

The structure of an XML document is represented by different files in the data model editor.
To read the content of an XML file, read the content of main file (the parent) then read the content of linked files (the children).
By default, when reading a file, a filter is automatically applied to the linked files in order to only read the records corresponding to the main file.
For example:
Browsing the different files of XML document
The email of this person can be retrieved when browsing the Person file.
To do so, all you have to do is position on the "Person" file and apply HReadFirst to the "Email" file.
In this case, the record read in the "Email" file will correspond to the first email associated with the current record in the "Person" file.
If this mechanism is disabled (HDeactivateAutoFilter), the record read in the "Email" file will correspond to the first record found in the Email file (and not to the child of the record read in the "Person" file).
To re-enable the positioning mechanism in the linked files, use HActivateAutoFilter.
Limitations

Queries

The queries are not available for the XML files.

Creating files

The functions for file creation (HCreation and HCreationIfNotFound) are not available for the XML files.

Filter

The following syntax of HFilter is not available for XML files:
<Result> = HFilter(<File name> , <Selection condition>)

Reading XML files

HRead reads the current record only. You cannot specify a record number other than the current one. To specify the current record number, use the hCurrentRecNum constant.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/18/2023

Send a report | Local help