PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • How to?
  • Method
  • Examples
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
Overview
Starting with version 23, WINDEV, WEBDEV and WINDEV Mobile include an XML parser to handle XML files that are multiple GB in size: for example, Open Street Map or Open Data France.
The reading speed and the memory consumption are improved on large XML files. Indeed, the file is not loaded in memory: it is just browsed.
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 an xmlReader variable.
    For example:
    Reader is xmlReader = XMLOpenReader("MyFile.xml")
  2. Browse the XML by using a FOR EACH syntax.
  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>
// Browse on 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