>Does anyone know how to use SAX2 in VFP 7.0?
>(I just upgraded to 7.0 to be able to use the
>new IMPLEMENTS sentence.)
>I need to import very large XML files (10MB),
>a task almost impossible with DOM.
>
>Nelson
>MCP VFP
Open msxml.dll in the Object browser, and drill down into its interfaces. YOu need to implement at least 2 interfaces:
IVBSAXContentHandler
IVBSAXErrorHandler
To do this, just drag the interface names to a code editing window. The code it generates will creates two classes, each implementing one of the interfaces, but you can combine the methods and the IMPLEMENTS statements to create a single class that implements both interfaces.
add your code to the appropriate methods in the handler classes. To use your class, create the SAXXMLReader object, and create your object. Assign the reference to your object to both the ContentHandler and ErrorHandler properties of the reader and load the document you want to use.
There's a good quick intro to using the VBSAXHandler features of MSXML at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml07162001.asp.
The samples are in VB, but the concepts are the same.
Erik Moore
Clientelligence