ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Exporting the query content
  • Exporting a single record
  • Array items
  • Miscellaneous
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
Exports the records found in a data file (HFSQL or OLE DB), view or query to an XML file.
Remark: A style sheet (".XLS" file) is automatically generated when creating the XML file.
Example
// Exporte tous les clients
HExportXML(CLIENT, "C:\TEMP\Client.xml", hExpCréation)
sdr is SQL Query =
[
SELECT * FROM FicTest
]
 
IF NOT HExecuteQuery(sdr) THEN
Trace(HErrorInfo())
ELSE
IF NOT HExportXML(sdr, "FicTest.xml", hExpCréation) THEN
Trace(HErrorInfo())
END
END
Syntax
<Result> = HExportXML(<Data file> [, <Path of the XML file> [, <Items to export>]] [, <Options> [, <eye>]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Data file>: Character string
Name of the data file, view or query used. If this name is not specified, HExportXML will use the last data file used by the last HFSQL function (function starting with "H").
<Path of the XML file>: Optional character string
Full path of XML file to be generated.
If this parameter is not specified, a <Data file>.XML file will be generated in the current directory.
<Items to export>: Optional character string
List of names of items to export. Names are delimited by single quotes and separated by commas or CR characters. The names of composite key items, binary items and binary memo items are ignored.
If this parameter corresponds to an empty string (""), all the items in the data file (except composite key, binary and binary memo items) are exported.
<Options>: Optional Integer constant
Mode for creating the XML file:
hExpBreakableThe export can be interrupted by pressing Esc.
If the export is interrupted, the XML file is valid and it only contains the records exported before the interruption.
hExpCreationIf the XML export file already exists, it is overwritten. An error occurs if this option is not specified and if the XML file exists.
hExpNormal
(default value)
Standard operating mode.
hExpWithoutXSLThe style sheet (".XSL" file) is not created.
<eye>: Optional control name or window name
Name of Progress Bar control or name of window used to show the progress of file creation.
Remarks

Exporting the query content

To export the query content, you must initialize the query (HExecuteQuery) before using HExportXML.

Exporting a single record

To export a single record to an XML string, use HRecordToXML.

Array items

If one of the exported items is an array item, each element of the array item is exported in a new level:
<FICHIER>
<RUB1>donnée de la rubrique 1</RUB1>
<RUB2>donnée de la rubrique 2</RUB2>
<RUBTAB>
<RUBTAB_1>donnée de l'élément 1</RUBTAB_1>
<RUBTAB_2>donnée de l'élément 2</RUBTAB_2>
<RUBTAB_3>donnée de l'élément 3</RUBTAB_3>
</RUBTAB>
...
</FICHIER>

Reminder: Composite key, binary memo or binary items are ignored.

Miscellaneous

The document entity of the generated XML file is named HF_DOCUMENT.
Component: wd280hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video HExportXml
https://youtu.be/3r_iC-6zcT4

https://windevdesenvolvimento.blogspot.com/2019/03/dicas-2046-windev-webdev-mobile-xml-21.html

// BTN EXPORTAR XML HEXPORTXML

HExportXML(empresa,"C:\TEMP\EMPRESA.XML","",hExpCreation,PROGBAR_BARRA_PROGRESSO)


amarildo
16 Mar. 2019

Last update: 06/22/2023

Send a report | Local help