Written by

Question Arto Alatalo · May 30, 2018

SAX XML Parser-error <STORE> on large xml import

%XML.Reader.OpenFile fails with SAX XML Parser-Error: <STORE> on importing large (1.5 GB) xml file. Any workaround for it?

My goal is one-time import of the file using classes generated by its XML schema.

Comments

Arto Alatalo  May 30, 2018 to Timothy Leavitt

Thanks, $zstorage worked fine

0
Arto Alatalo  May 30, 2018 to Warlin Garcia

Thanks but  I must use xml-to-object classes generated by the xsd

0
Warlin Garcia  May 30, 2018 to Arto Alatalo

Understand. I haven't tried this myself yet but in theory you should be able to initialize the Reader with an XML.Document object. This Document can be initialized (%OnNew) with a global of your choice in the same manner that TextReader can. 

0
Arto Alatalo  May 30, 2018 to Warlin Garcia

As I see it, xml-to-objects classes need DOM while the whole purpose of TextReaded is to read the xml without DOM creation

0
Warlin Garcia  May 30, 2018 to Arto Alatalo

Correct. The alternative using TextReader was to "avoid" increasing memory but if you have that option then the answers provided by Timothy are the way to go.

0
Warlin Garcia · May 30, 2018

For large files I use %XML.TextReader.ParseFile(). It allows me to pass a "concrete" global instead of using Cache defaults. Usually CacheTemp which is more limited than a concrete global. With this I'm able to process larger files. Granted, it's a little bit of more work (code) as you have to traverse the results (element by element) but it gets the job done.

0