Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I use SAX in VFP?
Message
De
31/01/2002 11:47:43
 
 
À
31/01/2002 10:21:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00613336
Message ID:
00613470
Vues:
25
Doug,

I was expermenting along the same lines as below. I have a problem with some of the method (IVBSAXContentHandler_put_documentLocator) not being defined in the IVBSAXContentHandler which I think may have something to do with my MSXML version.

What version of the MSXML do you have? Mine says Microsoft XML, v3.0 from the dropdown list in the Object Browser. But shows MSXML2 in the tree view of the object browser

I have the .Net Enterprise Beta 2 Aug 2001 installed in my machine which installed MSXML 3.0. I also have SQL Server 2000 installed which also installed the MSXML 3.0 and last but not the least, I have VFP 7 installed.

Is there a way to see what is the real version of MSXML I have?

>Hi Ramil.
>
>>I was wondering if SAX can be implemented using VFP?
>
>Yes, but only in VFP 7. First do MODI COMM SOMEFILE.PRG to open an editor window for an empty PRG. Then open the VFP 7 Object Browser, open the Microsoft XML COM library, expand the Interfaces node, and drag the IVBSAXContentHandler node to the PRG editor window. That will create code similar to the following (I changed the name of the class in the generated code):
DEFINE CLASS SFXMLSAXParser AS session OLEPUBLIC
>
>IMPLEMENTS IVBSAXContentHandler IN "c:\winnt\system32\msxml3.dll"
>
>PROCEDURE IVBSAXContentHandler_documentLocator() AS VARIANT;
>  HELPSTRING "Receive an object for locating the origin of SAX document events."
>* add user code here
>ENDPROC
>
>PROCEDURE IVBSAXContentHandler_startDocument() AS VOID;
>  HELPSTRING "Receive notification of the beginning of a document."
>* add user code here
>ENDPROC
>
>*** other code removed for brevity
>
>ENDDEFINE
To use this class, use code similar to the following (where lcXML is the XML you want to parse):
local loReader as msxml2.SAXXMLReader
>loReader = createobject('msxml2.SAXXMLReader')
>loParser = createobject('SFXMLSAXParser') && this is the class created above
>loReader.ContentHandler = loParser
>loReader.Parse(lcXML)
Hope this helps.
>
>Doug
ramil
~~ learning to stand still
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform