Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HELP! How do I use SAX2 in VFP 7.0 ?
Message
From
03/09/2001 22:10:08
 
 
To
03/09/2001 13:43:52
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00551840
Message ID:
00551911
Views:
20
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform