VFPXMLProgID
This property of the _VFP object, new to VFP 7, allows you to specify a COM component to override the default functionality of VFP's internal XML functions: CursorToXML(), XMLToCursor(), and XMLUpdateGram(). If you don't like the way these functions work, you can roll your own and put them in your own COM object.
Usage |
CProgID = _VFP.VFPXMLProgID _VFP.VFPXMLProgID = cProgID |
x=NEWOBJECT("myclass") DEFINE CLASS myclass AS session OLEPUBLIC IMPLEMENTS IVFPXML IN ; "c:\program files\microsoft visual foxpro 7\vfp7.exe" PROCEDURE IVFPXML_CursorToXML( ; bstrAlias AS STRING, nOutputFormat AS Number, nFlags AS Number, ; nRecords AS Number, bstrOutputFile AS STRING, bstrSchema AS STRING, ; bstrSchemaLocation AS STRING, bstrNameSpace AS STRING, ; pVFP AS VARIANT) AS VARIANT; HELPSTRING "Converts from a Cursor to XML" * add user code here ENDPROC PROCEDURE IVFPXML_XMLToCursor( ; pvarXMLSource AS VARIANT, bstrCursorName AS STRING, ; nFlags AS Number, pVFP AS VARIANT) AS Number; HELPSTRING "Converts from XML to a Cursor" * add user code here ENDPROC PROCEDURE IVFPXML_XMLUpdateGram(; nFlags AS Number, bstrCursorList AS STRING, ; pVFP AS VARIANT) AS VARIANT; HELPSTRING "Generates an XML UpdateGram" * add user code here ENDPROC ENDDEFINEAt this point, you're on your own. You're free to develop whatever replacement you'd like for CursorToXML(), XMLToCursor(), and XMLUpdateGram(). So if the built-in functions don't do things the way you want, or you've got some customized routines that are written in another language that you'd like to use, the VFPXMLProgID property lets you choose an alternative.
Example |
* Assumption: You have a COM object that does the conversions, * and it's based on the above code, and has the ProgID of * "AlternateXML.MyClass". _VFP.VFPXMLProgId = "AlternateXML.MyClass" |
See Also |
CursorToXML(), Define Class, _VFP, XMLToCursor(), XMLUpdateGram() |