09-29-2010 04:54 AM
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
09-29-2010 06:24 AM
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
09-29-2010 08:13 AM
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
09-29-2010 08:28 AM
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
09-29-2010 09:35 AM
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
09-29-2010 09:41 AM - edited 09-29-2010 09:44 AM
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
Matthias
ISAXContentHandler
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
09-30-2010 01:53 PM
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.
10-01-2010 01:29 AM
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.