ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XML file functions
  • Overview
  • How to?
  • Method
  • Examples
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
WINDEV, WEBDEV and WINDEV Mobile 23 and later feature a XML parser for handling large (multi-gigabyte) XML files. Some examples include data from Open Street Map or Open Data France.
Reading speed and memory consumption are significantly improved on large XML files. The file is not loaded into memory, it is simply read.
How to?

Method

To read a large XML file with the XML parser:
  1. Open the XML file to read with XMLOpenReader. This function is used initialize a variable of type xmlReader.
    For example:
    Reader is xmlReader = XMLOpenReader("MyFile.xml")
  2. Loop through the XML file using one of the FOR EACH syntaxes.
  3. The properties of xmlReader variable are used to find the characteristics of element read.

Examples

The example below present an xml file and different browse modes with the list of elements browsed.
<?xml version="1.0"?>
<aa>
<bb>
Text1

<cc>
</cc>
</bb>
<bb>
<cc>
</cc>
</bb>
</aa>
// Loop through a level
// Reader is the variable corresponding to the XML file
FOR EACH Reader
	// Read the start aa and end aa tags
	FOR EACH Reader
		// Read the start bb, end bb, start bb, end bb tags
		FOR EACH Reader
		// Read Text1 and the start cc, end cc
		// start cc, end cc tags
		END
	END
END
// Reader is the variable corresponding to the XML file
FOR EACH Reader IN-DEPTH
	// Read the start aa, start bb, text1, 
	// start cc, end cc, end bb, start bb,
	// start cc, end cc, end bb, end aa tags
END
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/30/2025

Send a report | Local help