|
|
|
|
- Overview
- How to?
- Method
- Examples
XML: Using files exceeding several gigabytes
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. Method To read a large XML file with the XML parser: - Open the XML file to read with XMLOpenReader. This function is used initialize an xmlReader variable.
For example:
Reader is xmlReader = XMLOpenReader("MyFile.xml")
- Browse the XML by using a FOR EACH syntax.
- 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
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|