DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

SAX parser for large xml file processing

Hello,

I need to process large xml files and would preferably use the msxml sax parser. How can I implement it into my Diadem data plugin script?

Thank you,

Rainer

0 Kudos
Message 1 of 8
(6,006 Views)

As far as I know thee is not even an ability to create an sax object in vbs.

MSXML2.SAXXMLReader40

So the only available option I see at this point is creating an ActiveX conrol by using vb and access this by vbs.

 

I assume this could work. Did you already fail using the DOM tree?

How big are the files?

 

Greetings

Andreas

0 Kudos
Message 2 of 8
(5,995 Views)

Ich kann ein "MSXML2.SAXXMLReader" Objekt erzeugen. Mir ist nicht klar wie ich jetzt den ContentHandler programmieren kann.

Die zu bearbeitenden Dateine sind bis zu einem GByte groß. ich würde es gerne vermeiden, die xml Datei komplett in den Speicher einlesen zu müssen.

Den ContentHandler habe ich schon einmal für EXCEL programmiert, mit DOM müßte ich nochmal komplett von vorne anfangen.

Gruß,

Rainer

 

0 Kudos
Message 3 of 8
(5,982 Views)

sorry to answer in german, I'll come back to english:

I'm able to create a MSXML2.SAXXMLReader object but don't know how to implement the content handler.

File size to be processed reaches 1GByte, so I prefer not too load the complete xml file into memory.

Moreover I've programmed the contenthandler already for EXCEL, for a DOM parser version I'd need to start from scratch again.

Thank you,

Rainer 

0 Kudos
Message 4 of 8
(5,978 Views)

Would it be possible to provide a small xml file and its reladed xls file?

Maybe it can easily be solved using a transformation.

 

Andreas

0 Kudos
Message 5 of 8
(5,968 Views)

Hello!


AFAIK is it not possible to use the MSXML SAX parser in VBS.


The reason is that the content handler has to implement the interface ISAXContentHandler, which is not possible in VBS (in contrast to VB). I think you have to implement the reader in another language than VBS and build a VBS compatible connection to the plug in via COM (e.g.).

 

BTW: Meiner einer wie auch Andreas (hoffentlich noch) sprechen zur Not auch Deutsch Smiley Happy


Matthias

ISAXContentHandler
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 6 of 8
(5,966 Views)

Thank you very much for your answers, although they contained no good news for me.

I just finished to crawl through the data with the DOM parser.

 

0 Kudos
Message 7 of 8
(5,927 Views)

Just conider thinking about an xslt transformation of your file.

The easiest way is to just transform it into a csv file or something like this.

And just use the native cvs reader.

 

I didn't do it with MS XML but it worked with xalan even with big files.

0 Kudos
Message 8 of 8
(5,911 Views)