I have huge XML files, approx 1GB each. They are so big that it can't be opened even in Notepad++ due to large volume of data.
I edited the XML and was able to parse it through DOMDocument60 (Thanks to the help provided at stackflow).
I was reading similar question at Improve speed of VBA but I am still not able to implement it properly, so need some guidance.
For example:
- How to load the xml in SAX ? Do i need to load it in DOMDocument60 before reading in SAX ?
- How to read line by line in SAX once imported ? In DOMDocument60, i can easily jump to any node and then loop through the childnodes but not sure how can i do this in SAX ?
- What time difference SAX can make to parsing huge XML, compared to DOMDocument? I haven't found any real time example on this.
- Is there any better option available than SAX in VBA, like any other library which I can use to speed up the process of Parsing.
Appreciate your suggestions. (Sample XML file is below)
<ParentNode type="actual">
<SampleObject class="POC" version="XYZ123" distName="Test1" id="Sample">
<p name="name">POC1</p>
<p name="object1">0</p>
<p name="object2">6</p>
<p name="object3">0</p>
</SampleObject>
<SampleObject class="POC" version="XYZ123" distName="Test2" id="Sample">
<p name="name">POC1</p>
<p name="object1">2</p>
<p name="object2">10</p>
<p name="object4">4</p>
<p name="object3">6</p>
</SampleObject>
<SampleObject class="POC" version="XYZ123" distName="Test3" id="Sample">
<p name="name">POC1</p>
<p name="object2">90</p>
<p name="object3">0</p>
</SampleObject>
<SampleObject class="POC" version="XYZ123" distName="Test4" id="Sample">
<p name="name">POC1</p>
<p name="object1">2</p>
<p name="object2">10</p>
<p name="object4">40</p>
<p name="object3">61</p>
</SampleObject>