PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV, WEBDEV, WINDEV Mobile 23 feature!
  • Overview
  • How to proceed?
  • Method
  • Examples
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The version 23 includes an XML parser that allows you to handle XML files of several Gigas: for example, Open Street Map or Open Data France.
The reading speed and the memory consumption are improved on huge XML files. Indeed, the file is not loaded in memory: it is just browsed.
How to proceed?

Method

To read a huge 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 required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment